mirror of
https://github.com/pdxlocations/contact.git
synced 2026-07-05 17:31:47 +02:00
Fix potential crash in sort nodes
This commit is contained in:
+1
-1
@@ -37,7 +37,7 @@ def get_node_list():
|
||||
if globals.interface.nodes:
|
||||
sorted_nodes = sorted(
|
||||
globals.interface.nodes.values(),
|
||||
key = lambda node: (node['lastHeard'] if 'lastHeard' in node else 0),
|
||||
key = lambda node: (node['lastHeard'] if ('lastHeard' in node and isinstance(node['lastHeard'], int)) else 0),
|
||||
reverse = True)
|
||||
return [node['num'] for node in sorted_nodes]
|
||||
return []
|
||||
|
||||
Reference in New Issue
Block a user