Api: Fix 'uninitialized value' warning when no token is set

This commit is contained in:
Daniel Friesel 2023-01-03 10:12:53 +01:00
parent cf7f993309
commit 04d096014e
No known key found for this signature in database
GPG key ID: 100D5BFB5166E005

View file

@ -71,7 +71,10 @@ sub get_v1 {
} }
my $token = $self->get_api_token($uid); my $token = $self->get_api_token($uid);
if ( $api_token ne $token->{$api_action} ) { if ( not $api_token
or not $token->{$api_action}
or $api_token ne $token->{$api_action} )
{
$self->render( $self->render(
json => { json => {
error => 'Invalid token', error => 'Invalid token',