diff --git a/C4/Auth.pm b/C4/Auth.pm index 26240a425b..1a6141c372 100644 --- a/C4/Auth.pm +++ b/C4/Auth.pm @@ -1218,10 +1218,10 @@ sub checkauth { my $branches = { map { $_->branchcode => $_->unblessed } Koha::Libraries->search->as_list }; if ( C4::Context->preference('StaffLoginRestrictLibraryByIP') ) { # we have to check they are coming from the right ip range - my $domain = $branches->{$branchcode}->{'branchip'}; + my $domain = $branches->{$branchcode}->{'branchip'} // q{}; $domain =~ s|\.\*||g; $domain =~ s/\s+//g; - if ( $ip !~ /^$domain/ ) { + if ( $domain && $ip !~ /^$domain/ ) { $cookie = $cookie_mgr->replace_in_list( $cookie, $query->cookie( -name => 'CGISESSID', -value => '',