[open-ils-commits] r16195 - trunk/Open-ILS/src/perlmods/OpenILS/Application/Acq (erickson)
svn at svn.open-ils.org
svn at svn.open-ils.org
Fri Apr 9 14:35:08 EDT 2010
Author: erickson
Date: 2010-04-09 14:35:03 -0400 (Fri, 09 Apr 2010)
New Revision: 16195
Modified:
trunk/Open-ILS/src/perlmods/OpenILS/Application/Acq/Invoice.pm
Log:
api: some sanity checks
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Acq/Invoice.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Acq/Invoice.pm 2010-04-09 13:57:03 UTC (rev 16194)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Acq/Invoice.pm 2010-04-09 18:35:03 UTC (rev 16195)
@@ -214,7 +214,8 @@
$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 @@
}
];
- 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};
More information about the open-ils-commits
mailing list