[BUGFIX] Check if a method exists before calling it

Change-Id: Ibfdbad9a074fe6b50bb0dea7f66788848f41c935
Resolves: #585990
Reviewed-on: https://review.typo3.org/29934
Reviewed-by: Jo Hasenau
Tested-by: Jo Hasenau