Throw exception, don't return null in Conversation::create

This commit is contained in:
Mikael Nordfeldth 2014-03-01 17:19:10 +01:00
parent 5c505d8539
commit 5144c0cb78

View File

@ -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();