Guard coord

This commit is contained in:
WQY\qiong
2023-03-22 21:19:37 +08:00
parent 19a5b860b6
commit c6d74e3cad

View File

@@ -7,7 +7,9 @@ def _to_client_point(coord: str) -> dict[str, float]:
def get_node_coord(name: str, id: str) -> dict[str, float]:
row = read(name, f"select * from coordinates where node = '{id}'")
row = try_read(name, f"select * from coordinates where node = '{id}'")
if row == None:
return {}
return _to_client_point(row['coord'])