From f1aa3f8f6e378a2fd212590cb3c7b426c014e8ba Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Wed, 1 Apr 2020 18:41:53 +0200 Subject: [PATCH] luci-base: ui.js: properly handle null choices in dropdown constructor Signed-off-by: Jo-Philipp Wich --- modules/luci-base/htdocs/luci-static/resources/ui.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/luci-base/htdocs/luci-static/resources/ui.js b/modules/luci-base/htdocs/luci-static/resources/ui.js index acc37008d..163edb8ea 100644 --- a/modules/luci-base/htdocs/luci-static/resources/ui.js +++ b/modules/luci-base/htdocs/luci-static/resources/ui.js @@ -929,7 +929,7 @@ var UIDropdown = UIElement.extend(/** @lends LuCI.ui.Dropdown.prototype */ { * expression. Only applicable when `create` is `true`. */ __init__: function(value, choices, options) { - if (typeof(choices) != 'object') + if (!L.isObject(choices)) choices = {}; if (!Array.isArray(value)) -- 2.25.1