From 61fe4bede1a59cf5983650835522a9d298d5074a Mon Sep 17 00:00:00 2001 From: senator Date: Tue, 23 Nov 2010 21:38:28 +0000 Subject: [PATCH] Serials: Fix error in batch receiving when trying to change the shelving 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 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Serial.pm b/Open-ILS/src/perlmods/OpenILS/Application/Serial.pm index 4393d40c89..444429fa24 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Serial.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Serial.pm @@ -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); -- 2.11.0