]> git.proxmox.com Git - pve-client.git/commitdiff
JSONSchema: fix getopt when invoking without arguments
authorDietmar Maurer <dietmar@proxmox.com>
Wed, 6 Jun 2018 04:37:22 +0000 (06:37 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Wed, 6 Jun 2018 04:37:22 +0000 (06:37 +0200)
PVE/JSONSchema.pm

index 0e722b81b0812c104a80eef3e526dec746884baa..edd1caf92a073e055f2e80d6d19f67ca1a71f394 100644 (file)
@@ -1406,6 +1406,8 @@ sub get_options {
            raise("too many arguments\n", code => HTTP_BAD_REQUEST)
                if scalar(@$args) != 0;
        }
            raise("too many arguments\n", code => HTTP_BAD_REQUEST)
                if scalar(@$args) != 0;
        }
+    } else {
+       raise("not enough arguments\n", code => HTTP_BAD_REQUEST) if ref($arg_param) && scalar(@$arg_param);
     }
 
     if (my $pd = $schema->{properties}->{password}) {
     }
 
     if (my $pd = $schema->{properties}->{password}) {