]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Abort on failure instead of return early success
authorMikael Nordfeldth <mmn@hethane.se>
Tue, 13 Jan 2015 12:18:57 +0000 (13:18 +0100)
committerMikael Nordfeldth <mmn@hethane.se>
Tue, 13 Jan 2015 12:18:57 +0000 (13:18 +0100)
plugins/OStatus/classes/Ostatus_profile.php

index 264c91337697f1da41e25692251dcc8d39d52011..6f5380e68ace71f2c49ac194f12cb5d1a2fbd8b5 100644 (file)
@@ -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;
     }
 
     /**