Catrope has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/286994

Change subject: Avoid fatal when EchoUnreadWikis::newFromUser() returns false
......................................................................

Avoid fatal when EchoUnreadWikis::newFromUser() returns false

Bug: T134428
Change-Id: Ie0a0ba77fa764f112836f1a8ad331e734a83df92
(cherry picked from commit c469692d16efefabfa50ea83b35d2b3ee3e7902d)
---
M Hooks.php
1 file changed, 5 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Echo 
refs/changes/94/286994/1

diff --git a/Hooks.php b/Hooks.php
index e687fc6..15b4052 100644
--- a/Hooks.php
+++ b/Hooks.php
@@ -821,9 +821,11 @@
                        !$user->getOption( 'echo-dismiss-beta-invitation' )
                ) {
                        $unreadWikis = EchoUnreadWikis::newFromUser( $user );
-                       $counts = $unreadWikis->getUnreadCounts();
-                       if ( count( $counts ) > 1 ) {
-                               $sk->getOutput()->addJsConfigVars( 
'wgEchoShowBetaInvitation', true );
+                       if ( $unreadWikis ) {
+                               $counts = $unreadWikis->getUnreadCounts();
+                               if ( count( $counts ) > 1 ) {
+                                       $sk->getOutput()->addJsConfigVars( 
'wgEchoShowBetaInvitation', true );
+                               }
                        }
                }
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie0a0ba77fa764f112836f1a8ad331e734a83df92
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Echo
Gerrit-Branch: wmf/1.27.0-wmf.22
Gerrit-Owner: Catrope <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to