From edc6d423ec1cb01b1577cd64a35cf8915c7eaf7b Mon Sep 17 00:00:00 2001 From: "WQY\\qiong" Date: Sat, 4 Feb 2023 14:44:32 +0800 Subject: [PATCH] Get source guard --- api/s18_sources.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/api/s18_sources.py b/api/s18_sources.py index 7730916..1baeab8 100644 --- a/api/s18_sources.py +++ b/api/s18_sources.py @@ -14,7 +14,9 @@ def get_source_schema(name: str) -> dict[str, dict[str, Any]]: def get_source(name: str, node: str) -> dict[str, Any]: - s = read(name, f"select * from sources where node = '{node}'") + s = try_read(name, f"select * from sources where node = '{node}'") + if s == None: + return {} d = {} d['node'] = str(s['node']) d['s_type'] = str(s['type'])