diff --git a/typo3/sysext/core/Classes/Database/ReferenceIndex.php b/typo3/sysext/core/Classes/Database/ReferenceIndex.php
index d56bdcf2c08e9fc0258cc01d4ed1af22d12e60e9..20571f3f581c2113afca4fcb7c9d75222fc4d7a2 100644
--- a/typo3/sysext/core/Classes/Database/ReferenceIndex.php
+++ b/typo3/sysext/core/Classes/Database/ReferenceIndex.php
@@ -463,7 +463,7 @@ class ReferenceIndex implements LoggerAwareInterface
                     ];
                 }
                 // For "flex" fieldtypes we need to traverse the structure looking for db references of course!
-                if ($conf['type'] === 'flex') {
+                if ($conf['type'] === 'flex' && is_string($value) && $value !== '') {
                     // Get current value array:
                     // NOTICE: failure to resolve Data Structures can lead to integrity problems with the reference index. Please look up
                     // the note in the JavaDoc documentation for the function FlexFormTools->getDataStructureIdentifier()