From 60272fc348a6a21da823542bceadd424f27148d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartosz=20Dziewo=C5=84ski?= Date: Mon, 25 Jan 2021 15:15:35 +0100 Subject: [PATCH] Fix cookie loading hack If the module is loaded on a page where DiscussionTools is not supposed to be enabled, wgDiscussionToolsFeaturesEnabled will be undefined, and the code will crash before it can set the cookie that enables it for future page views. Bug: T272850 Change-Id: Ia1c40cfc3cbee62823f1806bd20229883905677a --- modules/controller.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/controller.js b/modules/controller.js index eabcd9c92..32155149e 100644 --- a/modules/controller.js +++ b/modules/controller.js @@ -4,7 +4,7 @@ var $pageContainer, newTopicController, $overlay, - featuresEnabled = mw.config.get( 'wgDiscussionToolsFeaturesEnabled' ), + featuresEnabled = mw.config.get( 'wgDiscussionToolsFeaturesEnabled' ) || {}, Parser = require( './Parser.js' ), ThreadItem = require( './ThreadItem.js' ), logger = require( './logger.js' ),