From a46e7f24a9aa4817a6fe81647aa2c85be096f72b Mon Sep 17 00:00:00 2001 From: Physton Date: Sat, 15 Jul 2023 08:56:50 +0800 Subject: [PATCH] Fix bug --- scripts/physton_prompt/get_translate_apis.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/physton_prompt/get_translate_apis.py b/scripts/physton_prompt/get_translate_apis.py index f7f3019..1c6abae 100644 --- a/scripts/physton_prompt/get_translate_apis.py +++ b/scripts/physton_prompt/get_translate_apis.py @@ -64,6 +64,9 @@ def privacy_translate_api_config(data_key, data): if not find: return data api_item = find + if 'config' not in api_item or not api_item['config']: + return data + for config in api_item['config']: # 如果有 privacy 的属性并且为 True if 'privacy' in config and config['privacy'] and config['type'] == 'input': @@ -96,6 +99,8 @@ def unprotected_translate_api_config(data_key, data): if not find: return data api_item = find + if 'config' not in api_item or not api_item['config']: + return data storage_data = st.get(data_key)