oldRecord might be missing from recordSet
authorPhilipp Schüle <p.schuele@metaways.de>
Tue, 27 May 2014 07:07:13 +0000 (09:07 +0200)
committerPhilipp Schüle <p.schuele@metaways.de>
Tue, 27 May 2014 07:38:32 +0000 (09:38 +0200)
Change-Id: I712bd17d30e4e6c26e143cc50718dcf236a9a283
Reviewed-on: http://gerrit.tine20.com/customers/697
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
Tested-by: Philipp Schüle <p.schuele@metaways.de>
tine20/Tinebase/Controller/Record/Abstract.php

index 7a56254..e7bb55b 100644 (file)
@@ -1815,7 +1815,7 @@ abstract class Tinebase_Controller_Record_Abstract
                         // do not try to update if the record hasn't changed
                         $oldRecord = $oldRecords->getById($record->getId());
                         
-                        if (! empty($oldRecord->diff($record)->diff)) {
+                        if ($oldRecord && ! empty($oldRecord->diff($record)->diff)) {
                             if (Tinebase_Core::isLogLevel(Zend_Log::INFO)) {
                                 Tinebase_Core::getLogger()->info(__METHOD__ . '::' . __LINE__. ' Updating dependent record with id = "' . $record->getId() . '" on property ' . $_property . ' for ' . $this->_applicationName . ' ' . $this->_modelName);
                             }