Some libraries do not use PIN-codes.

Do a check if the patron has a PIN-code, before attempting
to decrypt it.

diff --git a/members/nl-search.pl b/members/nl-search.pl
index 29ec13e..19d4f3e 100755
--- a/members/nl-search.pl
+++ b/members/nl-search.pl
@@ -124,7 +124,6 @@ if ( $op && $op eq 'search' ) {
         'B_zipcode'    => scalar $cgi->param('m_postnr'),
         'B_city'       => scalar $cgi->param('m_sted'),
         'B_country'    => scalar $cgi->param('m_land'),
-        'password'     => NLDecodePin( $cgi->param('pin') ),
         'dateexpiry'   => scalar $cgi->param('gyldig_til'),
         'email'        => scalar $cgi->param('epost'),
         'mobile'       => scalar $cgi->param('tlf_mobil'),
@@ -133,6 +132,10 @@ if ( $op && $op eq 'search' ) {
         'branchcode'   => $userenv->{'branch'},
         'categorycode' => scalar $cgi->param('categorycode'),
     );
+    # Some patrons do not have a PIN-code in NL
+    if ( $cgi->param('pin') ne "" ) {
+         $borrower{'password'} = NLDecodePin( $cgi->param('pin') );
+    }
     # Add the new patron
     my $borrowernumber = &AddMember(%borrower);
     if ( $borrowernumber ) {
@@ -147,7 +150,9 @@ if ( $op && $op eq 'search' ) {
         });
         $borrowersync->update({ 'syncstatus', 'synced' });
         $borrowersync->update({ 'lastsync',   $cgi->param('sist_endret') });
-        $borrowersync->update({ 'hashed_pin', $cgi->param('pin') });
+        if ( $cgi->param('pin') ne "" ) {
+            $borrowersync->update({ 'hashed_pin', $cgi->param('pin') });
+        }
         # Try to sync in real time. If this fails it will be picked up by the cronjob
         NLSync({ 'borrowernumber' => $borrowernumber });
         # Redirect to the edit screen


Add patch to fix crashes importing NL-users without PIN
Add patch to fix crashes importing NL-users without PIN
