From 798a09c89be415014f4ee3b90e7276f0d2130af9 Mon Sep 17 00:00:00 2001 From: Marc MERLIN Date: Sat, 12 Jan 2013 18:02:44 -0800 Subject: [PATCH] Fix 2 small problems of using undefined hash entries. --- lib/Insteon/AllLinkDatabase.pm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/Insteon/AllLinkDatabase.pm b/lib/Insteon/AllLinkDatabase.pm index 31d67c0de..2759ae48c 100755 --- a/lib/Insteon/AllLinkDatabase.pm +++ b/lib/Insteon/AllLinkDatabase.pm @@ -1219,7 +1219,9 @@ sub add_duplicate_link_address sub delete_duplicate_link_address { my ($self, $address) = @_; - my $num_duplicate_link_addresses = @{$$self{aldb}{duplicates}}; + my $num_duplicate_link_addresses = 0; + + $num_duplicate_link_addresses = @{$$self{aldb}{duplicates}} if (defined $$self{aldb}{duplicates}); if ($num_duplicate_link_addresses) { my @temp_duplicates = (); @@ -1239,7 +1241,8 @@ sub add_empty_address { my ($self, $address) = @_; # before adding it, make sure that it isn't already in the list!! - my $num_addresses = @{$$self{aldb}{empty}}; + my $num_addresses = 0; + $num_addresses = @{$$self{aldb}{empty}} if (defined $$self{aldb}{empty}); my $exists = 0; if ($num_addresses and $address) {