summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Spooren <mail@aparcar.org>2021-07-26 00:36:19 +0200
committerPaul Spooren <mail@aparcar.org>2021-08-25 21:52:00 -1000
commit505b671c210de07977321067c49a89570a33ebfa (patch)
treee8fe8680ad17cdf60e1aa249c834d945215d373e
parentb41f37739e28210f0997fd1bb8d98cfee93cfa6d (diff)
luci-app-attendedsysupgrade: fix empty array condition
In JavaScript (other than in Python) an empty array is considered `true` within if statements. Fix this by checking for the array length rather than its existence. This fixes the issue of an empty dropdown menu in case the user is running the latest release. Signed-off-by: Paul Spooren <mail@aparcar.org>
-rw-r--r--applications/luci-app-attendedsysupgrade/htdocs/luci-static/resources/view/attendedsysupgrade/overview.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/applications/luci-app-attendedsysupgrade/htdocs/luci-static/resources/view/attendedsysupgrade/overview.js b/applications/luci-app-attendedsysupgrade/htdocs/luci-static/resources/view/attendedsysupgrade/overview.js
index f6d31a35be..3ee99684da 100644
--- a/applications/luci-app-attendedsysupgrade/htdocs/luci-static/resources/view/attendedsysupgrade/overview.js
+++ b/applications/luci-app-attendedsysupgrade/htdocs/luci-static/resources/view/attendedsysupgrade/overview.js
@@ -255,7 +255,7 @@ function check_sysupgrade(server_url, current_version, target, board_name, packa
}
}
}
- if (candidates) {
+ if (candidates.length) {
var m, s, o;
var mapdata = {