Aude has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/357595 )

Change subject: Fix method call on non-object in PageConnectionPresentationModel
......................................................................

Fix method call on non-object in PageConnectionPresentationModel

Title can sometimes be null in EchoEvent so we
need to check both that it's a title and it exists.

Bug: T167285
Change-Id: I96484fe7a6f0689b7099f6de0d52e83f14b8106e
---
M client/includes/Notifications/PageConnectionPresentationModel.php
1 file changed, 7 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/95/357595/1

diff --git a/client/includes/Notifications/PageConnectionPresentationModel.php 
b/client/includes/Notifications/PageConnectionPresentationModel.php
index a7eaeb2..a3c15f4 100644
--- a/client/includes/Notifications/PageConnectionPresentationModel.php
+++ b/client/includes/Notifications/PageConnectionPresentationModel.php
@@ -35,7 +35,13 @@
         * @see EchoEventPresentationModel::canRender()
         */
        public function canRender() {
-               return $this->event->getTitle()->exists();
+               $title = $this->event->getTitle();
+
+               if ( $title !== null ) {
+                       return $title->exists();
+               }
+
+               return false;
        }
 
        /**

-- 
To view, visit https://gerrit.wikimedia.org/r/357595
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I96484fe7a6f0689b7099f6de0d52e83f14b8106e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Aude <aude.w...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to