Serials: Fix error in batch receiving when trying to change the shelving
authorsenator <senator@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 23 Nov 2010 21:38:28 +0000 (21:38 +0000)
committersenator <senator@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 23 Nov 2010 21:38:28 +0000 (21:38 +0000)
location of the previous item in the stream when there /is/ no previous
item in the stream

git-svn-id: svn://svn.open-ils.org/ILS/trunk@18838 dcc99617-32d9-48b4-a31d-7c20da2025e4

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

index 4393d40..444429f 100644 (file)
@@ -1258,6 +1258,7 @@ sub _unit_by_iss_and_str {
             }
         }
     }) or return $e->die_event;
+    return 0 if not @$unit;
 
     $e->retrieve_serial_unit($unit->[0]->{"id"}) or $e->die_event;
 }
@@ -1267,6 +1268,7 @@ sub move_previous_unit {
 
     my $prev_unit = _unit_by_iss_and_str($e,$prev_iss,$curr_item->stream);
     return $prev_unit if defined $U->event_code($prev_unit);
+    return 0 if not $prev_unit;
 
     if ($prev_unit->location != $new_loc) {
         $prev_unit->location($new_loc);