]> git.proxmox.com Git - pve-access-control.git/commit - src/PVE/TokenConfig.pm
token: avoid undef warning if no tokens are configured
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 15 Apr 2020 15:13:59 +0000 (17:13 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 15 Apr 2020 15:14:01 +0000 (17:14 +0200)
commit856c101e97b1ba45e87a33f44e678f6b3f186e34
treebb869cce3381d12008e94a1107a8e539b0ed8a1c
parent0ae051a4d6c60285e5d66896a9089e16beae8a8f
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>
PVE/TokenConfig.pm