diff --git a/Supporters/lib/Supporters.pm b/Supporters/lib/Supporters.pm index 79c7e62..f35a720 100644 --- a/Supporters/lib/Supporters.pm +++ b/Supporters/lib/Supporters.pm @@ -1447,8 +1447,9 @@ sub _readLedgerData($) { while (my $line = ) { next if $line =~ /^\s*$/; die "Invalid line in @cmd output:\n $line" - unless $line =~ /^\s*([^\d]+)\s+([\d\-]+)\s+(\S+)\s+\$\s*(\-?\s*[\d,\.]+)\s*$/; + unless $line =~ /^\s*([^\d]+)\s+([\d\-]+)\s+(\S*)\s+\$\s*(\-?\s*[\d,\.]+)\s*$/; my($type, $date, $entityId, $amount) = ($1, $2, $3, $4); + next unless defined $entityId and $entityId !~ /^\s*$/; if (defined $self->{programTypeSearch}) { if ($type =~ /$self->{programTypeSearch}{annual}/) { $type = 'Annual'; diff --git a/Supporters/t/Supporters.t b/Supporters/t/Supporters.t index 10e6478..6cca9fe 100644 --- a/Supporters/t/Supporters.t +++ b/Supporters/t/Supporters.t @@ -52,6 +52,7 @@ Supporters:Match Pledge 2015-02-26 Whitman-Dick \$-300.00 Supporters:Monthly 2015-02-16 Olson-Margaret \$-10.00 Supporters:Monthly 2015-06-30 Olson-Margaret \$-10.00 Supporters:Annual 2015-03-04 Harris-Joan \$-120.00 +Supporters:Annual 2016-01-10 \$-120.00 FAKE_LEDGER_TEST_DATA_END =item Public-facing methods of the module, as follows: