return empty list for LoadJsonStrToList when inputing is blank

This commit is contained in:
刘雪峰
2024-10-10 15:16:06 +08:00
parent 1fda44f5e8
commit 30ac286ab8
+1 -1
View File
@@ -555,7 +555,7 @@ class LoadJsonStrToList:
def load_json(self, json_str: str):
if len(json_str.strip()) == 0:
return ([{}],)
return ([],)
json = simplejson.loads(json_str)
if isinstance(json, list):
return (json,)