]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Add a check in Notice->asActivityObject that we're actually returning such a thing!
authorMikael Nordfeldth <mmn@hethane.se>
Sat, 16 Jan 2016 20:13:26 +0000 (21:13 +0100)
committerMikael Nordfeldth <mmn@hethane.se>
Sat, 16 Jan 2016 20:13:26 +0000 (21:13 +0100)
classes/Notice.php

index 020df0c4589ece6e5d8b7b2e8b3f1a8cfd3070af..963b24ba5e3289a39eb20be49801fa0794ba5ba5 100644 (file)
@@ -2128,6 +2128,11 @@ class Notice extends Managed_DataObject
             Event::handle('EndActivityObjectFromNotice', array($this, &$object));
         }
 
+        if (!$object instanceof ActivityObject) {
+            common_log(LOG_ERR, 'Notice asActivityObject created something else for uri=='._ve($this->getUri()).': '._ve($object));
+            throw new ServerException('Notice asActivityObject created something else.');
+        }
+
         return $object;
     }