From: Mikael Nordfeldth <mmn@hethane.se> Date: Mon, 19 May 2014 16:34:44 +0000 (+0200) Subject: There's no guarantee we have an Ostatus_profile for Feedsub X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=3c322abafc79d9c9432d813cf942b4db2ac435e1;p=quix0rs-gnu-social.git There's no guarantee we have an Ostatus_profile for Feedsub --- diff --git a/plugins/OStatus/classes/FeedSub.php b/plugins/OStatus/classes/FeedSub.php index 83ceb35254..338c2f5144 100644 --- a/plugins/OStatus/classes/FeedSub.php +++ b/plugins/OStatus/classes/FeedSub.php @@ -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();