To make it visible when the API return undefined values.
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
sub data_to_text {
my ($data, $propdef) = @_;
sub data_to_text {
my ($data, $propdef) = @_;
+ return '' if !defined($data);
+
if (defined($propdef)) {
if (my $type = $propdef->{type}) {
if ($type eq 'boolean') {
if (defined($propdef)) {
if (my $type = $propdef->{type}) {
if ($type eq 'boolean') {
return $code->($data);
}
}
return $code->($data);
}
}
- return '' if !defined($data);
if (my $class = ref($data)) {
return to_json($data, { canonical => 1 });
if (my $class = ref($data)) {
return to_json($data, { canonical => 1 });