]> git.proxmox.com Git - pve-common.git/blobdiff - src/PVE/SectionConfig.pm
fix #2696: avoid 'undefined value' warning in 'pvesh help unknown'
[pve-common.git] / src / PVE / SectionConfig.pm
index 394aae6582926e3de80f043621ab5419887c9049..b46b59ed259fae053b0880e3f1a7deb3acab9ca0 100644 (file)
@@ -2,12 +2,13 @@ package PVE::SectionConfig;
 
 use strict;
 use warnings;
+
+use Carp;
 use Digest::SHA;
+
 use PVE::Exception qw(raise_param_exc);
 use PVE::JSONSchema qw(get_standard_option);
 
-use Data::Dumper;
-
 my $defaultData = {
     options => {},
     plugins => {},
@@ -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};