From 43accc31c5d6d7cfe1e820d80d3042e335ebad3d Mon Sep 17 00:00:00 2001 From: rbalocca Date: Fri, 18 Jan 2008 13:24:46 -0800 Subject: Check for undefined values before using them --- scripts/VyattaConfig.pm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/VyattaConfig.pm b/scripts/VyattaConfig.pm index 6c37073..15837d4 100644 --- a/scripts/VyattaConfig.pm +++ b/scripts/VyattaConfig.pm @@ -345,12 +345,19 @@ sub listNodeStatus { my %nodehash = (); # find deleted nodes first + if(!$self || !$path ) { + return %nodehash; + } + @nodes = $self->listDeleted("$path"); + if(!@nodes) { + return %nodehash; + } + foreach my $node (@nodes) { if ($node =~ /.+/) { $nodehash{$node} = "deleted" }; } - @nodes = (); @nodes = $self->listNodes("$path"); foreach my $node (@nodes) { if ($node =~ /.+/) { -- cgit v1.2.3