summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorrbalocca <rbalocca@fugazi.vyatta.com>2008-01-18 13:24:46 -0800
committerrbalocca <rbalocca@fugazi.vyatta.com>2008-01-18 13:24:46 -0800
commit43accc31c5d6d7cfe1e820d80d3042e335ebad3d (patch)
tree4319d1604b9a6688368636bbcc546437f2b35c17 /scripts
parent5c2667059d175aeccc37348377066ddd5c06d6ef (diff)
downloadvyatta-cfg-43accc31c5d6d7cfe1e820d80d3042e335ebad3d.tar.gz
vyatta-cfg-43accc31c5d6d7cfe1e820d80d3042e335ebad3d.zip
Check for undefined values before using them
Diffstat (limited to 'scripts')
-rw-r--r--scripts/VyattaConfig.pm9
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 =~ /.+/) {