Bug 8905: Error when accessing invalid authority
The GetAuthority shim does not check that authority retrieval was successful, and therefore can call ->record on an undefined value. This can be reproduced by trying to load an invalid authority record using bulkmarcimport. There may be other ways to trigger it, but I'm not sure what they are. Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Paul Poulain <paul.poulain@biblibre.com> another way to trigger this error is just forging your URL with a wrong authid !
This commit is contained in:
parent
215c8f4e3b
commit
cc9b23d3d7
1 changed files with 1 additions and 0 deletions
|
@ -856,6 +856,7 @@ Returns MARC::Record of the authority passed in parameter.
|
|||
sub GetAuthority {
|
||||
my ($authid)=@_;
|
||||
my $authority = Koha::Authority->get_from_authid($authid);
|
||||
return unless $authority;
|
||||
return ($authority->record);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue