Explorar o código

Fix bug where empty txn file causes crash

Daniel Sheffield %!s(int64=3) %!d(string=hai) anos
pai
achega
38b572c81b
Modificáronse 1 ficheiros con 4 adicións e 2 borrados
  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)