diff --git a/services/case_service.py b/services/case_service.py index ac535efa9e7dfd5a04f46fdb105a118c8ca900d0..401159b7a017eff3930dd198e69ef6f56c3586d8 100644 --- a/services/case_service.py +++ b/services/case_service.py @@ -256,6 +256,9 @@ async def get_follow_module_tree(node_id): if result['parent'] not in module_tree: module_tree[result['parent']] = list() module_tree[result['parent']].append(result) + if len(module_tree) == 0: + root['children'] = [] + return root, True __build_module_tree(module_tree[int(node_id)], module_tree) root['children'] = module_tree[int(node_id)] return root, True