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
This commit is contained in:
Mikael Nordfeldth 2015-02-13 01:02:03 +01:00
parent 25207c89d1
commit 1d2dbef9fb

View File

@ -806,6 +806,9 @@ class QvitterPlugin extends Plugin {
* @return boolean hook flag * @return boolean hook flag
*/ */
public function onEndSetApiUser($user) { public function onEndSetApiUser($user) {
if (!$user instanceof User) {
return true;
}
$user_id = $user->id; $user_id = $user->id;
$notification = new QvitterNotification(); $notification = new QvitterNotification();