You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@plc4x.apache.org by sr...@apache.org on 2022/08/02 10:54:34 UTC

[plc4x] 02/02: fix(plc-simulator/cbus): fixed NPE while stopping monitor

This is an automated email from the ASF dual-hosted git repository.

sruehl pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/plc4x.git

commit f8935f069a7e72044bddebcba3b8577d71e30da9
Author: Sebastian Rühl <sr...@apache.org>
AuthorDate: Tue Aug 2 12:54:17 2022 +0200

    fix(plc-simulator/cbus): fixed NPE while stopping monitor
---
 .../apache/plc4x/simulator/server/cbus/protocol/CBusServerAdapter.java | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/sandbox/plc-simulator/src/main/java/org/apache/plc4x/simulator/server/cbus/protocol/CBusServerAdapter.java b/sandbox/plc-simulator/src/main/java/org/apache/plc4x/simulator/server/cbus/protocol/CBusServerAdapter.java
index 41d36a7c8..a20f4f4bd 100644
--- a/sandbox/plc-simulator/src/main/java/org/apache/plc4x/simulator/server/cbus/protocol/CBusServerAdapter.java
+++ b/sandbox/plc-simulator/src/main/java/org/apache/plc4x/simulator/server/cbus/protocol/CBusServerAdapter.java
@@ -387,6 +387,9 @@ public class CBusServerAdapter extends ChannelInboundHandlerAdapter {
     }
 
     private void stopMonitor() {
+        if (sf == null) {
+            return;
+        }
         LOGGER.info("Stopping monitor");
         sf.cancel(false);
         sf = null;