[BUGFIX] Add check if $fileObject is a correct instance

In some cases the $fileObject is null and getName() is called on
a null object which results in a fatal error.

This patch add a check if $fileObject is an instance of
FileInterface before call getName().
Also correct the wrong doc comment.

Resolves: #60773
Releases: 6.2, master
Change-Id: I6f3f817a089c665d8cc9e0b3369d6d690ffaf620
Reviewed-on: http://review.typo3.org/32713
Reviewed-by: Markus Klein <klein.t3@reelworx.at>
Tested-by: Markus Klein <klein.t3@reelworx.at>