config: prevent empty content list when content type 'none' is not supported

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
This commit is contained in:
Fabian Ebner
2021-06-18 12:59:36 +02:00
committed by Thomas Lamprecht
parent d96b789aed
commit 03c487e553

View File

@ -345,6 +345,10 @@ sub decode_value {
die "unable to combine 'none' with other content types\n";
}
if (scalar(keys $res->%*) == 0 && !$valid_content->{none}) {
die "storage does not support content type 'none'\n";
}
return $res;
} elsif ($key eq 'format') {
my $valid_formats = $def->{format}->[0];