From 3d97cbcc83b06a7650713ba5e8383a5a8dda3abd Mon Sep 17 00:00:00 2001 From: erickson Date: Fri, 9 Apr 2010 18:35:03 +0000 Subject: [PATCH] api: some sanity checks git-svn-id: svn://svn.open-ils.org/ILS/trunk@16195 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/perlmods/OpenILS/Application/Acq/Invoice.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Acq/Invoice.pm b/Open-ILS/src/perlmods/OpenILS/Application/Acq/Invoice.pm index 458ce99b45..a6533259a1 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Acq/Invoice.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Acq/Invoice.pm @@ -214,7 +214,8 @@ sub find_entry_debits { $query->{where}->{'+acqfdeb'}->{amount} = $amount if $amount; my $debits = $e->json_query($query); - return $e->search_acq_fund_debit({id => [map { $_->{id} } @$debits]}); + my $debit_ids = [map { $_->{id} } @$debits]; + return (@$debit_ids) ? $e->search_acq_fund_debit({id => $debit_ids}) : []; } @@ -264,7 +265,7 @@ sub fetch_invoice_impl { } ]; - my $invoice = $e->retrieve_acq_invoice($args); + my $invoice = $e->retrieve_acq_invoice($args) or return $e->die_event; return $invoice if $options->{no_flesh_misc} or $options->{keep_li_marc}; $_->lineitem->clear_marc for @{$invoice->entries}; -- 2.11.0