mirror of
https://git.proxmox.com/git/pve-access-control
synced 2025-08-02 21:49:30 +00:00
token: avoid undef warning if no tokens are configured
Initially the config may not even exist, and so the first token create would give one then a ugly warning like: > Use of uninitialized value $raw in split at .. Handle that case, empty config (where we get '') was fine already, so explicitly check for definedness, not truthiness. Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
0ae051a4d6
commit
856c101e97
@ -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*$/;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user