diff --git a/authorities/authorities.pl b/authorities/authorities.pl index e5150f7015..96c599a87f 100755 --- a/authorities/authorities.pl +++ b/authorities/authorities.pl @@ -552,11 +552,15 @@ if ( $op eq 'cud-change-framework' ) { } my $dbh = C4::Context->dbh; +my $authobj = Koha::Authorities->find($authid); +if ( defined $authid && !$authid || $authid && !$authobj ) { + print $input->redirect("/cgi-bin/koha/errors/404.pl"); # escape early + exit; +} if(!$authtypecode) { - $authtypecode = $authid ? Koha::Authorities->find($authid)->authtypecode : ''; + $authtypecode = $authid ? $authobj->authtypecode : ''; } -my $authobj = Koha::Authorities->find($authid); my $count = $authobj ? $authobj->get_usage_count : 0; my ($template, $loggedinuser, $cookie)