Skip to content

Commit 1c81a19

Browse files
committed
fix: BackupListView.appendAll
1 parent 6c9402b commit 1c81a19

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

nottodbox/scripts/widgets/documents.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,10 +177,11 @@ def __init__(self, parent: BackupView) -> None:
177177
self.setUniformItemSizes(False)
178178

179179
def appendAll(self) -> None:
180-
backups = json.loads(self.parent_.index.data(ITEM_DATAS["backup"]))
180+
if self.parent_.index.data(ITEM_DATAS["backup"]) is not None and self.parent_.index.data(ITEM_DATAS["backup"]) != "":
181+
backups = json.loads(self.parent_.index.data(ITEM_DATAS["backup"]))
181182

182-
for date, content in backups.items():
183-
self.appendItem(date, content)
183+
for date, content in backups.items():
184+
self.appendItem(date, content)
184185

185186
def appendItem(self, date: str, content: str) -> None:
186187
self.items[date] = QStandardItem()

0 commit comments

Comments
 (0)