Skip to content

Commit

Permalink
Merge pull request #189 from krkeegan/fix_issue_17
Browse files Browse the repository at this point in the history
Insteon: Catch Error if Device ID in All_Link_Failure Does Not Exist
  • Loading branch information
krkeegan committed May 21, 2013
2 parents 72e1fb7 + b2e3a68 commit de04c71
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions lib/Insteon_PLM.pm
Original file line number Diff line number Diff line change
Expand Up @@ -636,10 +636,15 @@ sub _parse_data {
. "$failure_device and group: $failure_group") if $main::Debug{insteon} >= 2;

my $failed_object = &Insteon::get_object($failure_device,'01');
my $message = new Insteon::InsteonMessage('all_link_direct_cleanup', $failed_object,
$self->active_message->command, $failure_group);
push(@{$$failed_object{command_stack}}, $message);
$failed_object->_process_command_stack();
if (ref $failed_object){
my $message = new Insteon::InsteonMessage('all_link_direct_cleanup', $failed_object,
$self->active_message->command, $failure_group);
push(@{$$failed_object{command_stack}}, $message);
$failed_object->_process_command_stack();
} else {
&::print_log("[Insteon_PLM] WARN: Device ID: $failure_device does not exist. You may "
. "want to run delete orphans to remove this link from your PLM");
}
} else {
&::print_log("[Insteon_PLM] DEBUG2: Received all-link cleanup failure."
. " But there is no pending message.") if $main::Debug{insteon} >= 2;
Expand Down

0 comments on commit de04c71

Please sign in to comment.