From ff993c99a44a7f367d19f4716f5d0ce1329c38ca Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Fri, 4 Sep 2015 12:19:02 +0930 Subject: [PATCH] Correct check that a translation is an object typeof translation === 'object' returns true when translation is null --- framework/core/js/lib/Translator.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/core/js/lib/Translator.js b/framework/core/js/lib/Translator.js index 5f3dfd30d..82e65a11c 100644 --- a/framework/core/js/lib/Translator.js +++ b/framework/core/js/lib/Translator.js @@ -51,7 +51,7 @@ export default class Translator { // If this translation has multiple options and a 'count' has been provided // in the input, we'll work out which option to choose using the `plural` // method. - if (typeof translation === 'object' && typeof input.count !== 'undefined') { + if (translation && typeof translation === 'object' && typeof input.count !== 'undefined') { translation = translation[this.plural(extractText(input.count))]; }