[BUGFIX] Missing check before foreach loop 28/45328/2
authorOliver Hader <oliver@typo3.org>
Thu, 17 Dec 2015 10:41:06 +0000 (11:41 +0100)
committerAlexander Opitz <opitz.alexander@googlemail.com>
Thu, 17 Dec 2015 11:03:36 +0000 (12:03 +0100)
PHP Warning: Invalid argument supplied for foreach()
in typo3/sysext/core/Classes/DataHandling/DataHandler.php line 5285

Resolves: #72289
Releases: master, 6.2
Change-Id: If83dee7261ce3dd6d1fbf3bb81d8f2e53741c4c7
Reviewed-on: https://review.typo3.org/45328
Reviewed-by: Michael Oehlhof <typo3@oehlhof.de>
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Tested-by: Andreas Fernandez <typo3@scripting-base.de>
Reviewed-by: Alexander Opitz <opitz.alexander@googlemail.com>
Tested-by: Alexander Opitz <opitz.alexander@googlemail.com>
typo3/sysext/core/Classes/DataHandling/DataHandler.php

index 7ed80fa..504b60a 100644 (file)
@@ -5282,6 +5282,9 @@ class DataHandler
     {
         $conf = $GLOBALS['TCA'][$table]['columns'];
         $row = BackendUtility::getRecord($table, $uid, '*', '', false);
+        if (empty($row)) {
+            return;
+        }
         foreach ($row as $field => $value) {
             $this->deleteRecord_procBasedOnFieldType($table, $uid, $field, $value, $conf[$field]['config'], $undeleteRecord);
         }