section config: use croak so that the error is from the callers POV
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 29 Apr 2020 12:51:59 +0000 (14:51 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 29 Apr 2020 12:51:59 +0000 (14:51 +0200)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/PVE/SectionConfig.pm

index cf87d6f6c3faa5c41f200f5f890cfb29f8304c9b..b46b59ed259fae053b0880e3f1a7deb3acab9ca0 100644 (file)
@@ -3,6 +3,7 @@ package PVE::SectionConfig;
 use strict;
 use warnings;
 
+use Carp;
 use Digest::SHA;
 
 use PVE::Exception qw(raise_param_exc);
@@ -198,6 +199,8 @@ sub init {
 sub lookup {
     my ($class, $type) = @_;
 
+    croak "cannot lookup undefined type!" if !defined($type);
+
     my $pdata = $class->private();
     my $plugin = $pdata->{plugins}->{$type};