jenkins-bot has submitted this change and it was merged.

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


Avoid fatal when EchoUnreadWikis::newFromUser() returns false

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

Approvals:
  Catrope: Looks good to me, approved
  jenkins-bot: Verified



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/286951
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie0a0ba77fa764f112836f1a8ad331e734a83df92
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Echo
Gerrit-Branch: wmf/1.27.0-wmf.23
Gerrit-Owner: Catrope <[email protected]>
Gerrit-Reviewer: Catrope <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to