Skip to content

Commit

Permalink
Merge pull request #37 from marcmerlin/master
Browse files Browse the repository at this point in the history
Small fix mentioned on the mailing list a while ago to fix the use of undefined hash entries
  • Loading branch information
marcmerlin committed Jan 13, 2013
2 parents b412f8f + 798a09c commit 45356a7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/Insteon/AllLinkDatabase.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ();
Expand All @@ -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)
{
Expand Down

0 comments on commit 45356a7

Please sign in to comment.