]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Throw exception, don't return null in Conversation::create
authorMikael Nordfeldth <mmn@hethane.se>
Sat, 1 Mar 2014 16:19:10 +0000 (17:19 +0100)
committerMikael Nordfeldth <mmn@hethane.se>
Sat, 1 Mar 2014 16:19:10 +0000 (17:19 +0100)
classes/Conversation.php

index 9be6113fb8fe828e07937e62796c7705842d9eac..c76b0169ffbd48408e656c56f75de7fe55542879 100755 (executable)
@@ -63,8 +63,7 @@ class Conversation extends Managed_DataObject
     static function create(Notice $notice)
     {
         if (empty($notice->id)) {
-            common_debug('Tried to create conversation for not yet inserted notice');
-            return null;
+            throw new ServerException(_('Tried to create conversation for not yet inserted notice'));
         }
         $conv = new Conversation();
         $conv->created = common_sql_now();