Browse Source

Check for None before updating model

CURA-5670
Lipu Fei 6 years ago
parent
commit
b21200c6a8
1 changed files with 3 additions and 0 deletions
  1. 3 0
      plugins/Toolbox/src/AuthorsModel.py

+ 3 - 0
plugins/Toolbox/src/AuthorsModel.py

@@ -33,6 +33,9 @@ class AuthorsModel(ListModel):
 
     def _update(self):
         items = []
+        if not self._metadata:
+            self.setItems([])
+            return
 
         for author in self._metadata:
             items.append({