luci-base: ui.js: properly handle null choices in dropdown constructor
authorJo-Philipp Wich <jo@mein.io>
Wed, 1 Apr 2020 16:41:53 +0000 (18:41 +0200)
committerJo-Philipp Wich <jo@mein.io>
Wed, 1 Apr 2020 16:45:46 +0000 (18:45 +0200)
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit f1aa3f8f6e378a2fd212590cb3c7b426c014e8ba)

modules/luci-base/htdocs/luci-static/resources/ui.js

index 618b3941e9520f812a53e6a6230512979825290c..ba93dc657ba865f5515f126b2bb82b3483203b53 100644 (file)
@@ -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))