Throw exception, don't return null in Conversation::create
This commit is contained in:
parent
5c505d8539
commit
5144c0cb78
@ -63,8 +63,7 @@ class Conversation extends Managed_DataObject
|
|||||||
static function create(Notice $notice)
|
static function create(Notice $notice)
|
||||||
{
|
{
|
||||||
if (empty($notice->id)) {
|
if (empty($notice->id)) {
|
||||||
common_debug('Tried to create conversation for not yet inserted notice');
|
throw new ServerException(_('Tried to create conversation for not yet inserted notice'));
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
$conv = new Conversation();
|
$conv = new Conversation();
|
||||||
$conv->created = common_sql_now();
|
$conv->created = common_sql_now();
|
||||||
|
Loading…
Reference in New Issue
Block a user