From f1e68f9451c288925fcd48f973d83ef34a8a729d Mon Sep 17 00:00:00 2001 From: Stephane Bisson Date: Wed, 24 Feb 2016 11:42:03 -0500 Subject: [PATCH] Handle null user when trying to generate a link for notifications Bug: T127728 Change-Id: I87de2d10887216e3edf53c2972b6bf230191f0ea --- includes/formatters/EventPresentationModel.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/includes/formatters/EventPresentationModel.php b/includes/formatters/EventPresentationModel.php index 05d521146..a114c47d2 100644 --- a/includes/formatters/EventPresentationModel.php +++ b/includes/formatters/EventPresentationModel.php @@ -381,10 +381,14 @@ abstract class EchoEventPresentationModel implements JsonSerializable { } /** - * @param User $user + * @param User|null $user * @return array|null */ - final protected function getUserLink( User $user ) { + final protected function getUserLink( $user ) { + if ( !$user ) { + return null; + } + if ( !$this->userCan( Revision::DELETED_USER ) ) { return null; }