Browse Source

Fix bug where empty txn file causes crash

Daniel Sheffield 3 years ago
parent
commit
38b572c81b
1 changed files with 4 additions and 2 deletions
  1. 4 2
      widgets.py

+ 4 - 2
widgets.py

@@ -172,8 +172,10 @@ class GroceryTransactionEditor(urwid.WidgetPlaceholder):
                 #print(self.cur.mogrify(line))
                 #print(self.cur.mogrify(line))
                 #input()
                 #input()
                 self.cur.execute(line)
                 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)
         self.log = self.open(log)