luci-base: ui.js: properly handle null choices in dropdown constructor

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
Jo-Philipp Wich 2020-04-01 18:41:53 +02:00
parent 16f0997bdb
commit f1aa3f8f6e

View 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))