From a4a7c1f9f3b3f3967fd12694f3a8bd2748d2f6bc Mon Sep 17 00:00:00 2001 From: Matthew Hagan Date: Thu, 14 Apr 2022 12:16:59 +0100 Subject: [PATCH] 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 --- feeds/ucentral/usteer/files/usr/libexec/uchannel.uc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/feeds/ucentral/usteer/files/usr/libexec/uchannel.uc b/feeds/ucentral/usteer/files/usr/libexec/uchannel.uc index 8bae8b47b..029b0974a 100755 --- a/feeds/ucentral/usteer/files/usr/libexec/uchannel.uc +++ b/feeds/ucentral/usteer/files/usr/libexec/uchannel.uc @@ -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; }