diff --git a/typo3/sysext/core/Classes/LinkHandling/FileLinkHandler.php b/typo3/sysext/core/Classes/LinkHandling/FileLinkHandler.php
index e1df63952017669547a787909811658b34ac79bd..f6d7ce8dfbc1eca55e43b9834bf6d03ae4fb74a5 100644
--- a/typo3/sysext/core/Classes/LinkHandling/FileLinkHandler.php
+++ b/typo3/sysext/core/Classes/LinkHandling/FileLinkHandler.php
@@ -86,10 +86,10 @@ class FileLinkHandler implements LinkHandlingInterface
      */
     protected function resolveFile(array $data): ?FileInterface
     {
-        if (isset($data['uid'])) {
+        if (is_numeric($data['uid'] ?? false)) {
             return $this->getResourceFactory()->getFileObject($data['uid']);
         }
-        if (isset($data['identifier'])) {
+        if (is_string($data['identifier'] ?? false) && $data['identifier'] !== '') {
             return $this->getResourceFactory()->getFileObjectFromCombinedIdentifier($data['identifier']);
         }
         return null;