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

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit f1aa3f8f6e)
This commit is contained in:
Jo-Philipp Wich 2020-04-01 18:41:53 +02:00
parent e5e71a55ab
commit 50c9be16b9

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