]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Make sure the saved Notice has an ID
authorMikael Nordfeldth <mmn@hethane.se>
Fri, 26 Feb 2016 00:11:20 +0000 (01:11 +0100)
committerMikael Nordfeldth <mmn@hethane.se>
Fri, 26 Feb 2016 00:11:20 +0000 (01:11 +0100)
classes/Notice.php

index 86eec8e3adebbec2d838eaaeb82fc77630798d54..892f2be30ea0908893333c269e14de381e11ddba 100644 (file)
@@ -997,7 +997,9 @@ class Notice extends Managed_DataObject
             }
         }
         if (!$stored instanceof Notice) {
-            throw new ServerException('StartNoticeSave did not give back a Notice');
+            throw new ServerException('StartNoticeSave did not give back a Notice.');
+        } elseif (empty($stored->id)) {
+            throw new ServerException('Supposedly saved Notice has no ID.');
         }
 
         // Only save 'attention' and metadata stuff (URLs, tags...) stuff if