usteer: uchannel.uc: check host_info exists

If another host has not set a status, for example when autochannel is
disabled, it will not show host_info when remote_hosts is called. This
fix adds a check for this condition.

Signed-off-by: Matthew Hagan <mnhagan88@gmail.com>
This commit is contained in:
Matthew Hagan
2022-04-14 12:16:59 +01:00
committed by John Crispin
parent 5cbac23e3f
commit a4a7c1f9f3

View File

@@ -258,8 +258,8 @@ function channel_balance(band, mask) {
function youngest() {
for (let ip, host in hosts) {
if (host.host_info.status == "overlap" &&
host.host_info.uptime < uptime) {
if (host.host_info?.status == "overlap" &&
host.host_info?.uptime < uptime) {
print("Found a younger host\n");
return 1;
}