diff options
author | rbalocca <rbalocca@fugazi.vyatta.com> | 2008-01-18 13:24:46 -0800 |
---|---|---|
committer | rbalocca <rbalocca@fugazi.vyatta.com> | 2008-01-18 13:24:46 -0800 |
commit | 43accc31c5d6d7cfe1e820d80d3042e335ebad3d (patch) | |
tree | 4319d1604b9a6688368636bbcc546437f2b35c17 | |
parent | 5c2667059d175aeccc37348377066ddd5c06d6ef (diff) | |
download | vyatta-cfg-43accc31c5d6d7cfe1e820d80d3042e335ebad3d.tar.gz vyatta-cfg-43accc31c5d6d7cfe1e820d80d3042e335ebad3d.zip |
Check for undefined values before using them
-rw-r--r-- | scripts/VyattaConfig.pm | 9 |
1 files changed, 8 insertions, 1 deletions
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 =~ /.+/) { |