From: Richard Jones Date: Mon, 8 Mar 2010 19:28:48 +0000 (+0000) Subject: inspector: Don't crash if $os->{kernels} does not exist. X-Git-Tag: 1.0.86~8 X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=ed6fc794c8a2f64f8b987137b54551f4380177f3;p=libguestfs.git inspector: Don't crash if $os->{kernels} does not exist. ie. on Windows. --- diff --git a/inspector/virt-inspector b/inspector/virt-inspector index cb892c0..707825e 100755 --- a/inspector/virt-inspector +++ b/inspector/virt-inspector @@ -407,13 +407,15 @@ sub output_text_os print " $_->{name} $_->{version}\n" } - print __" Kernels:\n"; - my @kernels = @{$os->{kernels}}; - foreach (@kernels) { - print " $_->{version} ($_->{arch})\n"; - my @modules = @{$_->{modules}}; - foreach (@modules) { - print " $_\n"; + if ($os->{kernels}) { + print __" Kernels:\n"; + my @kernels = @{$os->{kernels}}; + foreach (@kernels) { + print " $_->{version} ($_->{arch})\n"; + my @modules = @{$_->{modules}}; + foreach (@modules) { + print " $_\n"; + } } }