Only attempt to add the Patron ID to the Checkin Response message
authordjfiander <djfiander>
Tue, 30 May 2006 01:02:12 +0000 (01:02 +0000)
committerdjfiander <djfiander>
Tue, 30 May 2006 01:02:12 +0000 (01:02 +0000)
if the ILS actually provides a valid $patron structure

Sip/MsgType.pm

index 610c576..f5a4271 100644 (file)
@@ -672,7 +672,9 @@ sub handle_checkin {
 
     if ($protocol_version eq '2.00') {
        $resp .= maybe_add(FID_SORT_BIN, $status->sort_bin);
-       $resp .= maybe_add(FID_PATRON_ID, $status->patron->id);
+       if ($status->patron) {
+           $resp .= add_field(FID_PATRON_ID, $status->patron->id);
+       }
        $resp .= maybe_add(FID_MEDIA_TYPE, $status->item->sip_media_type);
        $resp .= maybe_add(FID_ITEM_PROPS, $status->item->sip_item_properties);
     }