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:18 +0000 (18:45 +0200)
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
modules/luci-base/htdocs/luci-static/resources/ui.js

index acc37008d1b26206c9aca0059dab1454cc4667f4..163edb8eaedbb89e5d9bd596e8d41986348cb82b 100644 (file)
@@ -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))