Explorar el Código

Fix bug where empty txn file causes crash

Daniel Sheffield hace 3 años
padre
commit
38b572c81b
Se han modificado 1 ficheros con 4 adiciones y 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)