From 50c9be16b92a7c7a0087d18ecf171c9c44b8e698 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 (cherry picked from commit f1aa3f8f6e378a2fd212590cb3c7b426c014e8ba) --- 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 618b3941e..ba93dc657 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)) -- 2.25.1