Skip to content

Commit

Permalink
Ensure node exists when handler is disposed (openhab#792)
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Jackson <chris@cd-jackson.com>

Signed-off-by: Chris Jackson <chris@cd-jackson.com>
  • Loading branch information
cdjackson authored and Pierre Gaufillet committed Sep 7, 2023
1 parent 4d8802e commit 876a4db
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -577,16 +577,17 @@ public void dispose() {

stopPolling();

if (nodeIeeeAddress != null) {
if (coordinatorHandler != null) {
if (coordinatorHandler != null) {
coordinatorHandler.removeNetworkNodeListener(this);
coordinatorHandler.removeAnnounceListener(this);

if (nodeIeeeAddress != null && coordinatorHandler.getNode(nodeIeeeAddress) != null) {
ZclOtaUpgradeServer otaServer = getOtaServer(coordinatorHandler.getNode(nodeIeeeAddress));
if (otaServer != null) {
otaServer.removeListener(this);
}

coordinatorHandler.removeNetworkNodeListener(this);
coordinatorHandler.removeAnnounceListener(this);
}

nodeIeeeAddress = null;
}

Expand Down

0 comments on commit 876a4db

Please sign in to comment.