From a85a08ff35987c6deddb61735ab3c4de74f2f67f Mon Sep 17 00:00:00 2001 From: Mikael Nordfeldth Date: Sat, 16 Jan 2016 21:13:26 +0100 Subject: [PATCH] Add a check in Notice->asActivityObject that we're actually returning such a thing! --- classes/Notice.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/classes/Notice.php b/classes/Notice.php index 020df0c458..963b24ba5e 100644 --- a/classes/Notice.php +++ b/classes/Notice.php @@ -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; } -- 2.39.5