Jhernandez has uploaded a new change for review.

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

Change subject: Fix JS error when wgGatherCollections is not defined
......................................................................

Fix JS error when wgGatherCollections is not defined

Bug: T93738
Change-Id: I7f6bf3092554f1b49248c47417e1b51c2b3dbc79
---
M resources/ext.gather.watchstar/init.js
1 file changed, 2 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Gather 
refs/changes/57/199257/1

diff --git a/resources/ext.gather.watchstar/init.js 
b/resources/ext.gather.watchstar/init.js
index 21891c6..0fd9e72 100644
--- a/resources/ext.gather.watchstar/init.js
+++ b/resources/ext.gather.watchstar/init.js
@@ -18,7 +18,8 @@
                var collections = mw.config.get( 'wgGatherCollections' ),
                        // Show to anonymous or a user with only watchstar as a 
collection
                        // note ES5 method usage
-                       showToUser = user.isAnon() || Object.keys( collections 
).length === 1;
+                       showToUser = user.isAnon() ||
+                               ( collections && Object.keys( collections 
).length === 1 );
 
                if (
                        // User only has a watchlist, meaning they have not 
created a collection

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7f6bf3092554f1b49248c47417e1b51c2b3dbc79
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Gather
Gerrit-Branch: master
Gerrit-Owner: Jhernandez <jhernan...@wikimedia.org>

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

Reply via email to