From 41dfd8a0f82b39cd61ccc6bc4638ea271b7c621e Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Mon, 19 Oct 2020 23:54:32 -0400 Subject: [PATCH] return early for undefined i18n messages could happen when we map over a list of objects to create buttons and one only has an icon --- ui/i18n.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ui/i18n.js b/ui/i18n.js index 9faa2cc50..a3363ba75 100644 --- a/ui/i18n.js +++ b/ui/i18n.js @@ -79,6 +79,10 @@ function removeContextMetadata(message) { } export function __(message, tokens) { + if (!message) { + return ''; + } + const language = localStorageAvailable ? window.localStorage.getItem('language') || 'en' : window.navigator.language.slice(0, 2) || 'en';