Abort on failure instead of return early success

This commit is contained in:
Mikael Nordfeldth 2015-01-13 13:18:57 +01:00
parent bc51c6b64f
commit db7154c63b
1 changed files with 3 additions and 3 deletions

View File

@ -101,10 +101,10 @@ class Ostatus_profile extends Managed_DataObject
} }
$profile = Profile::getKV('id', $this->profile_id); $profile = Profile::getKV('id', $this->profile_id);
if ($profile instanceof Profile) { if (!$profile instanceof Profile) {
return $profile; throw new NoProfileException($this->profile_id);
} }
throw new NoProfileException($this->profile_id); return $profile;
} }
/** /**