From: Mikael Nordfeldth Date: Tue, 13 Jan 2015 12:18:57 +0000 (+0100) Subject: Abort on failure instead of return early success X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=db7154c63b8891884cf0c230b80ff8e75fea251e;p=quix0rs-gnu-social.git Abort on failure instead of return early success --- diff --git a/plugins/OStatus/classes/Ostatus_profile.php b/plugins/OStatus/classes/Ostatus_profile.php index 264c913376..6f5380e68a 100644 --- a/plugins/OStatus/classes/Ostatus_profile.php +++ b/plugins/OStatus/classes/Ostatus_profile.php @@ -101,10 +101,10 @@ class Ostatus_profile extends Managed_DataObject } $profile = Profile::getKV('id', $this->profile_id); - if ($profile instanceof Profile) { - return $profile; + if (!$profile instanceof Profile) { + throw new NoProfileException($this->profile_id); } - throw new NoProfileException($this->profile_id); + return $profile; } /**