[BUGFIX] Possible fatal if sys_notes table is broken
authorAnja Leichsenring <aleichsenring@ab-softlab.de>
Sat, 4 Aug 2012 16:44:59 +0000 (18:44 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Sun, 5 Aug 2012 20:57:42 +0000 (22:57 +0200)
Change-Id: I581f48bd031344aa43aa227f7c5e0a34e1cd3ea8
Fixes: #39528
Releases: 6.0
Reviewed-on: http://review.typo3.org/13451
Reviewed-by: Markus Günther
Tested-by: Markus Günther
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
typo3/sysext/sys_note/Classes/Domain/Repository/SysNoteRepository.php

index 8dd9f11..e3b3cc4 100644 (file)
@@ -48,6 +48,12 @@ class Tx_SysNote_Domain_Repository_SysNoteRepository {
                        'sorting'
                );
 
+                       // exec_SELECTgetRows can return NULL if the query failed. This is
+                       // transformed here to an empty array instead.
+               if ($records === NULL) {
+                       $records = array();
+               }
+
                foreach ($records as $key => $record) {
                        $records[$key]['tstamp'] = new DateTime('@' . $record['tstamp']);
                        $records[$key]['author'] = t3lib_BEfunc::getRecord('be_users', $record['cruser']);