protecting ws_ou fetching to prevent errors and unnecessary calls
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 5 Sep 2006 12:30:28 +0000 (12:30 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 5 Sep 2006 12:30:28 +0000 (12:30 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@5960 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Application/Circ/ScriptBuilder.pm

index 585d931..9537e0f 100644 (file)
@@ -80,8 +80,10 @@ sub build_runner {
 
        if( ref $ctx->{requestor} ) {
                $runner->insert( "$evt.requestor",      $ctx->{requestor}, 1);
-               $runner->insert( "$evt.location",       
-                       $editor->retrieve_actor_org_unit($ctx->{requestor}->ws_ou), 1);
+               if($ctx->{requestor}->ws_ou) {
+                       $runner->insert( "$evt.location",       
+                               $editor->retrieve_actor_org_unit($ctx->{requestor}->ws_ou), 1);
+               }
        }
 
        $runner->insert( "$evt.patronItemsOut", $ctx->{patronItemsOut}, 1 );