From c865d6a942cae26de6c4c733c675610eb2473c53 Mon Sep 17 00:00:00 2001 From: Russell Schmidt Date: Tue, 28 Jan 2025 12:42:59 -0600 Subject: [PATCH] Fix crash in get node details The last heard timestamp apparently sometimes gets populated in the dict as None, instead of just not being present, which caused a crash. Check for None before tryint to use it. --- ui/curses_ui.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/curses_ui.py b/ui/curses_ui.py index d0914d9..0aefa89 100644 --- a/ui/curses_ui.py +++ b/ui/curses_ui.py @@ -34,7 +34,7 @@ def draw_node_details(): if 'user' in node and 'shortName' in node['user'] else "", f" | {node['user']['hwModel']}" if 'user' in node and 'hwModel' in node['user'] else "", - f" | {get_time_ago(node['lastHeard'])}" if 'lastHeard' in node else "", + f" | {get_time_ago(node['lastHeard'])}" if ('lastHeard' in node and node['lastHeard']) else "", f" | Hops: {node['hopsAway']}" if 'hopsAway' in node else "", f" | SNR: {node['snr']}dB" if ('snr' in node and 'hopsAway' in node and node['hopsAway'] == 0)