]> git.proxmox.com Git - pve-access-control.git/blobdiff - PVE/TokenConfig.pm
token: avoid undef warning if no tokens are configured
[pve-access-control.git] / PVE / TokenConfig.pm
index 94d87e5a3e4116d91fb89a9b8ae5e3415fd278f9..cfc60cc4244e5839a48142769873d5f5647d22a5 100644 (file)
@@ -12,8 +12,9 @@ my $parse_token_cfg = sub {
     my ($filename, $raw) = @_;
 
     my $parsed = {};
-    my @lines = split(/\n/, $raw);
+    return $parsed if !defined($raw);
 
+    my @lines = split(/\n/, $raw);
     foreach my $line (@lines) {
        next if $line =~ m/^\s*$/;