fix handling of last entry if there is none
authorDobrica Pavlinusic <dpavlin@rot13.org>
Wed, 29 Apr 2009 11:47:13 +0000 (11:47 +0000)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Wed, 29 Apr 2009 11:47:13 +0000 (11:47 +0000)
lib/LDAP/Koha.pm

index 7c2791c..38e4428 100644 (file)
@@ -247,8 +247,10 @@ sub search {
 
                }
 
 
                }
 
-               warn "### last entry ",$entry->dump( \*STDERR );
-               push @entries, $entry;
+               if ( $entry ) {
+                       warn "### last entry ",$entry->dump( \*STDERR );
+                       push @entries, $entry;
+               }
 
        } else {
                warn "UNKNOWN request: ",dump( $reqData );
 
        } else {
                warn "UNKNOWN request: ",dump( $reqData );