From a26ff53c762ac7daf9f54a264b5f6ef9b52e2a8c Mon Sep 17 00:00:00 2001 From: Simon Grim Date: Fri, 25 Mar 2016 03:21:07 +0500 Subject: [PATCH] add check for input string emptiness in filterLang() --- js/mobile_abstract.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/js/mobile_abstract.js b/js/mobile_abstract.js index cd7358c..8356330 100644 --- a/js/mobile_abstract.js +++ b/js/mobile_abstract.js @@ -543,7 +543,9 @@ function filterLang(string) { var langFilterReason = ''; var langFilterList = $.Options.filterLangList.val; - if (langFilterList.length > 0) { + if (!string) { + langFilterReason = polyglot.t('this is undefined', {'this': 'string'}); + } else if (langFilterList.length > 0) { var langFilterAccuracy = $.Options.filterLangAccuracy.val; langFilterPass = (langFilterMode === 'whitelist') ? false : true; langFilterReason = polyglot.t('this doesnt contain that', {'this': polyglot.t(langFilterMode), 'that': polyglot.t('language of this')});