From 7a6c48c30baa501e64cf4305b50a9b57b69e2466 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 --- js/lib/Translator.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/lib/Translator.js b/js/lib/Translator.js index 5f3dfd30d..82e65a11c 100644 --- a/js/lib/Translator.js +++ b/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))]; }