Skip to content

Commit

Permalink
Check user orcid_name field is not defined before equality
Browse files Browse the repository at this point in the history
  • Loading branch information
fatchild authored Nov 30, 2023
1 parent c3aec0c commit e0b9987
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/plugins/EPrints/Plugin/Event/CheckOrcidName.pm
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ sub check_name
$orcid_family =~ s/^\s+|\s+$//g;

my $name = $user->get_value( "orcid_name" );
if( $orcid_given ne $name->{given} || $orcid_family ne $name->{family} )
if( !defined $name->{given} || !defined $name->{family} || $orcid_given ne $name->{given} || $orcid_family ne $name->{family} )
{
$user->set_value( "orcid_name", {
family => $orcid_family,
Expand Down

0 comments on commit e0b9987

Please sign in to comment.