From 32ed385498bcfcbcca2ba20f438fa605ef207ac1 Mon Sep 17 00:00:00 2001 From: ibuler Date: Wed, 30 Sep 2020 12:20:13 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E8=B5=84=E4=BA=A7?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=9C=89=E6=97=B6=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/assets/utils.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apps/assets/utils.py b/apps/assets/utils.py index 6b4d8111a..870d93e62 100644 --- a/apps/assets/utils.py +++ b/apps/assets/utils.py @@ -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")