fix handling of last entry if there is none
[virtual-ldap] / 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 );