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: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=50c9be16b92a7c7a0087d18ecf171c9c44b8e698;p=project%2Fluci.git luci-base: ui.js: properly handle null choices in dropdown constructor Signed-off-by: Jo-Philipp Wich (cherry picked from commit f1aa3f8f6e378a2fd212590cb3c7b426c014e8ba) --- diff --git a/modules/luci-base/htdocs/luci-static/resources/ui.js b/modules/luci-base/htdocs/luci-static/resources/ui.js index 618b3941e9..ba93dc657b 100644 --- a/modules/luci-base/htdocs/luci-static/resources/ui.js +++ b/modules/luci-base/htdocs/luci-static/resources/ui.js @@ -399,7 +399,7 @@ var UISelect = UIElement.extend({ var UIDropdown = UIElement.extend({ __init__: function(value, choices, options) { - if (typeof(choices) != 'object') + if (!L.isObject(choices)) choices = {}; if (!Array.isArray(value))