[BUGFIX] Check arrays to avoid warnings

Change-Id: I04fbcad8f418f002f2da2dcd0545f6b33b1840ab
Resolves: #58928
Reviewed-on: https://review.typo3.org/30219
Reviewed-by: Jo Hasenau
Tested-by: Jo Hasenau