luci-app-attendedsysupgrade: fix empty array condition
authorPaul Spooren <mail@aparcar.org>
Sun, 25 Jul 2021 22:36:19 +0000 (00:36 +0200)
committerPaul Spooren <mail@aparcar.org>
Sun, 25 Jul 2021 22:36:19 +0000 (00:36 +0200)
commit7f5becc69e004f831c9dc09e0859c179b439c7d2
tree52c14677ca2203b4bcdd4e9dbc44ed19b98b970c
parent65a3166c499e0d020a24cedc47e59462fa2c4858
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>
applications/luci-app-attendedsysupgrade/htdocs/luci-static/resources/view/attendedsysupgrade/overview.js