]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
There's no guarantee we have an Ostatus_profile for Feedsub
authorMikael Nordfeldth <mmn@hethane.se>
Mon, 19 May 2014 16:34:44 +0000 (18:34 +0200)
committerMikael Nordfeldth <mmn@hethane.se>
Mon, 19 May 2014 16:34:44 +0000 (18:34 +0200)
plugins/OStatus/classes/FeedSub.php

index 83ceb35254f47f878717c5d7b3d1b504177f8e5e..338c2f51445de04e57c949653258450c2f6faa42 100644 (file)
@@ -512,7 +512,10 @@ class FeedSub extends Managed_DataObject
     {
         try {
             $oprofile = Ostatus_profile::getKV('feeduri', $this->getUri());
-            $profile = $oprofile->localProfile();
+            if ($oprofile instanceof Ostatus_profile) {
+                // Check if there's a profile. If not, handle the NoProfileException below
+                $profile = $oprofile->localProfile();
+            }
         } catch (NoProfileException $e) {
             // If the Ostatus_profile has no local Profile bound to it, let's clean it out at the same time
             $oprofile->delete();