Prevent warning when empty ControlDevice

This commit is contained in:
Isaac Connor
2025-10-24 16:59:48 -04:00
parent be98d56c43
commit 0baa4007e5

View File

@@ -118,7 +118,7 @@ Debug("Have " . $+{PASSWORD});
}
# Save the base url
$self->{BaseURL} = "http://$$self{host}:$$self{port}";
$ChannelID = $self->{Monitor}{ControlDevice} if $self->{Monitor}{ControlDevice} =~ /^\d+$/;
$ChannelID = $self->{Monitor}{ControlDevice} if $self->{Monitor}{ControlDevice} and ($self->{Monitor}{ControlDevice} =~ /^\d+$/);
$$self{realm} = defined($self->{Monitor}->{ControlDevice}) ? $self->{Monitor}->{ControlDevice} : '';
# Save and test the credentials