X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=classes%2FSubscription.php;h=70ccd724be66ee4f49679a528c01a2b7c20a8fdb;hb=3ad3535cd8d12787d1af95969b9576620abce4a9;hp=f40239989c7cd7674b7d4a954325dc546d65f700;hpb=c751be1c0639dd02432b8f7ddd365a91504e331c;p=quix0rs-gnu-social.git diff --git a/classes/Subscription.php b/classes/Subscription.php index f40239989c..70ccd724be 100644 --- a/classes/Subscription.php +++ b/classes/Subscription.php @@ -67,7 +67,7 @@ class Subscription extends Managed_DataObject 'subscription_token_idx' => array('token'), ), ); - } + } /* Static get */ function staticGet($k,$v=null) @@ -262,6 +262,14 @@ class Subscription extends Managed_DataObject $subscriber = Profile::staticGet('id', $this->subscriber); $subscribed = Profile::staticGet('id', $this->subscribed); + if (empty($subscriber)) { + throw new Exception(sprintf(_('No profile for the subscriber: %d'), $this->subscriber)); + } + + if (empty($subscribed)) { + throw new Exception(sprintf(_('No profile for the subscribed: %d'), $this->subscribed)); + } + $act = new Activity(); $act->verb = ActivityVerb::FOLLOW;