Check for sip_expire before trying to use it.
authorThomas Berezansky <tsbere@mvlc.org>
Thu, 31 Mar 2011 13:21:13 +0000 (09:21 -0400)
committerThomas Berezansky <tsbere@mvlc.org>
Thu, 31 Mar 2011 13:21:13 +0000 (09:21 -0400)
Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
Sip/MsgType.pm

index 2d828ff..b4acdbb 100644 (file)
@@ -969,7 +969,9 @@ sub handle_patron_info {
         # SIP 2.0 extensions used by Envisionware
         # Other types of terminals will ignore the fields, if
         # they don't recognize the codes
-        $resp .= maybe_add(FID_PATRON_EXPIRE, $patron->sip_expire);
+        if ($patron->can('sip_expire')) {
+            $resp .= maybe_add(FID_PATRON_EXPIRE, $patron->sip_expire);
+        }
         $resp .= maybe_add(FID_PATRON_BIRTHDATE, $patron->sip_birthdate);
         $resp .= maybe_add(FID_PATRON_CLASS, $patron->ptype);