[BUGFIX] Check arrays to avoid warnings

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