bailing out early on a call so it does not go to cstore if no id is there
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 27 Jul 2006 17:21:44 +0000 (17:21 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 27 Jul 2006 17:21:44 +0000 (17:21 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@5127 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm

index 254592f..38315e2 100644 (file)
@@ -717,12 +717,16 @@ sub fetch_copy_location_by_name {
 sub fetch_callnumber {
        my( $self, $id ) = @_;
        my $evt = undef;
+
+       my $e = OpenILS::Event->new( 'ASSET_CALL_NUMBER_NOT_FOUND', id => $id );
+       return( undef, $e ) unless $id;
+
        $logger->debug("Fetching callnumber $id");
 
        my $cn = $self->simplereq(
                'open-ils.cstore',
                'open-ils.cstore.direct.asset.call_number.retrieve', $id );
-       $evt = OpenILS::Event->new( 'ASSET_CALL_NUMBER_NOT_FOUND', id => $id ) unless $cn;
+       $evt = $e  unless $cn;
 
        return ( $cn, $evt );
 }