From: Jo-Philipp Wich Date: Wed, 1 Apr 2020 16:41:53 +0000 (+0200) Subject: luci-base: ui.js: properly handle null choices in dropdown constructor X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=f1aa3f8f6e378a2fd212590cb3c7b426c014e8ba;p=oweals%2Fluci.git luci-base: ui.js: properly handle null choices in dropdown constructor Signed-off-by: Jo-Philipp Wich --- 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))