From ed6fc794c8a2f64f8b987137b54551f4380177f3 Mon Sep 17 00:00:00 2001 From: Richard Jones Date: Mon, 8 Mar 2010 19:28:48 +0000 Subject: [PATCH] inspector: Don't crash if $os->{kernels} does not exist. ie. on Windows. --- inspector/virt-inspector | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) 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"; + } } } -- 1.8.3.1