From db7154c63b8891884cf0c230b80ff8e75fea251e Mon Sep 17 00:00:00 2001 From: Mikael Nordfeldth Date: Tue, 13 Jan 2015 13:18:57 +0100 Subject: [PATCH] Abort on failure instead of return early success --- plugins/OStatus/classes/Ostatus_profile.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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; } /**