From 621f8017c8834328de9bf54730bdb01c26247433 Mon Sep 17 00:00:00 2001 From: Sebastian Pipping Date: Wed, 26 Oct 2011 17:49:53 +0200 Subject: [PATCH] client-barcode: Allow empty commit (bug #17, broken by introduction of bulkbuy) --- client-barcode/freitagskasse.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/client-barcode/freitagskasse.py b/client-barcode/freitagskasse.py index 8391be6..588cd97 100644 --- a/client-barcode/freitagskasse.py +++ b/client-barcode/freitagskasse.py @@ -268,6 +268,9 @@ class Status: assert(self.logged_in()) def compress_deposit_commands(): + if not self.transfers: + return + dummy, initial_balance = self.transfers[0] balance_before = initial_balance compressed_deposit = DepositCommand(Decimal('0')) @@ -283,6 +286,9 @@ class Status: self.transfers = others def process_buy_commands_combined(): + if not self.transfers: + return + # Compress BuyCommands, use a single bulkbuy dummy, initial_balance = self.transfers[0] balance_before = initial_balance