fix: 修复资产列表有时的bug

pull/4788/head
ibuler 2020-09-30 12:20:13 +08:00 committed by 老广
parent b51eb4267d
commit 32ed385498
1 changed files with 4 additions and 0 deletions

View File

@ -125,6 +125,8 @@ class TreeService(Tree):
def assets(self, nid):
node = self.get_node(nid)
if not node:
return set()
return node.data.get("assets", set())
def valid_assets(self, nid):
@ -132,6 +134,8 @@ class TreeService(Tree):
def all_assets(self, nid):
node = self.get_node(nid)
if not node:
return set()
if node.data is None:
node.data = {}
all_assets = node.data.get("all_assets")