소스 검색

Fix bug where empty txn file causes crash

Daniel Sheffield 3 년 전
부모
커밋
38b572c81b
1개의 변경된 파일4개의 추가작업 그리고 2개의 파일을 삭제
  1. 4 2
      widgets.py

+ 4 - 2
widgets.py

@@ -172,8 +172,10 @@ class GroceryTransactionEditor(urwid.WidgetPlaceholder):
                 #print(self.cur.mogrify(line))
                 #input()
                 self.cur.execute(line)
-        self._apply_choice('ts', date)
-        self._apply_choice('store', store)
+        
+            if None not in (date, store):
+                self._apply_choice('ts', date)
+                self._apply_choice('store', store)
 
         self.log = self.open(log)