From 125cc356f344c470ffe559d6097e44f48408804f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Hanol?= Date: Mon, 7 Aug 2017 10:45:35 +0200 Subject: [PATCH] FIX: don't break the site when adding a navigation item without a 'name' field --- app/assets/javascripts/discourse/lib/plugin-api.js.es6 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/discourse/lib/plugin-api.js.es6 b/app/assets/javascripts/discourse/lib/plugin-api.js.es6 index 17e1456dea7..dccd781db92 100644 --- a/app/assets/javascripts/discourse/lib/plugin-api.js.es6 +++ b/app/assets/javascripts/discourse/lib/plugin-api.js.es6 @@ -539,7 +539,11 @@ class PluginApi { * }) */ addNavigationBarItem(item) { - addNavItem(item); + if (!item["name"]) { + console.warn("A 'name' is required when adding a Navigation Bar Item.", item); + } else { + addNavItem(item); + } } }