diff --git a/misc/migration_tools/merge_authority.pl b/misc/migration_tools/merge_authority.pl index 87a02f9f99..405b66ae14 100755 --- a/misc/migration_tools/merge_authority.pl +++ b/misc/migration_tools/merge_authority.pl @@ -55,8 +55,11 @@ $|=1; # flushes output my $authfrom = GetAuthority($mergefrom); my $authto = GetAuthority($mergeto); -my $authtypecodefrom = $mergefrom->authtypecode; -my $authtypecodeto = $mergeto->authtypecode; +die "Authority $mergefrom does not exist" unless $authfrom; +die "Authority $mergeto does not exist" unless $authto; + +my $authtypecodefrom = Koha::Authorities->find($mergefrom)->authtypecode; +my $authtypecodeto = Koha::Authorities->find($mergeto)->authtypecode; unless ($noconfirm || $batch) { print "************\n";