diff options
author | Daniel Friesel <derf@finalrewind.org> | 2023-01-03 10:12:53 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2023-01-03 10:12:53 +0100 |
commit | 04d096014e455b97ca3c9a54444af7811d87feae (patch) | |
tree | 4670a60977b9627a7e890b81c2e0419b0351bf68 /lib | |
parent | cf7f993309426604c67937f2363b9717fa1269f4 (diff) |
Api: Fix 'uninitialized value' warning when no token is set1.29.4
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/Travelynx/Controller/Api.pm | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Travelynx/Controller/Api.pm b/lib/Travelynx/Controller/Api.pm index f686222..8c47e9f 100755 --- a/lib/Travelynx/Controller/Api.pm +++ b/lib/Travelynx/Controller/Api.pm @@ -71,7 +71,10 @@ sub get_v1 { } 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( json => { error => 'Invalid token', |