From 1d2dbef9fb1bf6984430a5408378b7e5c3cab60b Mon Sep 17 00:00:00 2001 From: Mikael Nordfeldth Date: Fri, 13 Feb 2015 01:02:03 +0100 Subject: [PATCH] EndSetApiUser is not always a User GNU social will however make sure that whenever the event is called, User _has_ been set, but for anyone not stalking the nightly branch they will have less messages like this in their PHP error log: PHP Notice: Trying to get property of non-object in [...]/Qvitter/QvitterPlugin.php on line 810 --- QvitterPlugin.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/QvitterPlugin.php b/QvitterPlugin.php index c9bb856..1ac952b 100644 --- a/QvitterPlugin.php +++ b/QvitterPlugin.php @@ -806,6 +806,9 @@ class QvitterPlugin extends Plugin { * @return boolean hook flag */ public function onEndSetApiUser($user) { + if (!$user instanceof User) { + return true; + } $user_id = $user->id; $notification = new QvitterNotification();