summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2023-01-03 10:12:53 +0100
committerDaniel Friesel <derf@finalrewind.org>2023-01-03 10:12:53 +0100
commit04d096014e455b97ca3c9a54444af7811d87feae (patch)
tree4670a60977b9627a7e890b81c2e0419b0351bf68
parentcf7f993309426604c67937f2363b9717fa1269f4 (diff)
Api: Fix 'uninitialized value' warning when no token is set1.29.4
-rwxr-xr-xlib/Travelynx/Controller/Api.pm5
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',