Strict type check against false in User_group

This commit is contained in:
Mikael Nordfeldth 2013-10-20 17:15:46 +02:00
parent e868ebfe77
commit 9811783f19
1 changed files with 2 additions and 2 deletions

View File

@ -630,7 +630,7 @@ class User_group extends Managed_DataObject
$profile->query('BEGIN'); $profile->query('BEGIN');
$id = $profile->insert(); $id = $profile->insert();
if (empty($id)) { if ($id === false) {
$profile->query('ROLLBACK'); $profile->query('ROLLBACK');
throw new ServerException(_('Profile insertion failed')); throw new ServerException(_('Profile insertion failed'));
} }
@ -654,7 +654,7 @@ class User_group extends Managed_DataObject
$result = $group->insert(); $result = $group->insert();
if (!$result) { if ($result === false) {
common_log_db_error($group, 'INSERT', __FILE__); common_log_db_error($group, 'INSERT', __FILE__);
// TRANS: Server exception thrown when creating a group failed. // TRANS: Server exception thrown when creating a group failed.
throw new ServerException(_('Could not create group.')); throw new ServerException(_('Could not create group.'));