protecting against non-existant DB items
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 2 Jan 2006 04:45:46 +0000 (04:45 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 2 Jan 2006 04:45:46 +0000 (04:45 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@2584 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/asset.pm
Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/biblio.pm

index a0995d8..80a32a0 100644 (file)
@@ -251,6 +251,7 @@ sub fleshed_copy {
        for my $id ( @ids ) {
                next unless $id;
                my $cp = asset::copy->retrieve($id);
+               next unless $cp;
 
                my $cp_fm = $cp->to_fieldmapper;
                $cp_fm->circ_lib( $cp->circ_lib->to_fieldmapper );
index 6aef206..87a1656 100644 (file)
@@ -101,6 +101,8 @@ sub record_by_copy {
        SQL
 
        my $rec = biblio::record_entry->retrieve( $r );
+       return undef unless ($rec)
+
        my $r_fm = $rec->to_fieldmapper;
        $r_fm->fixed_fields( $rec->record_descriptor->next->to_fieldmapper );