From b0ae85195549af2f3deb8b9a9aa0318595dd0432 Mon Sep 17 00:00:00 2001 From: Jochen Meierhofer Date: Tue, 5 Nov 2024 11:30:18 +0100 Subject: [PATCH] fix(plc4j/drivers/s7): fix NPE when Camel can not establish connection immediately during route start --- .../apache/plc4x/java/s7/readwrite/protocol/S7HMuxImpl.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/S7HMuxImpl.java b/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/S7HMuxImpl.java index 1a987940d0..d58b8e32c4 100644 --- a/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/S7HMuxImpl.java +++ b/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/S7HMuxImpl.java @@ -235,7 +235,8 @@ public void channelUnregistered(ChannelHandlerContext ctx) throws Exception { embededChannel.pipeline().fireUserEventTriggered(new DisconnectedEvent()); } - logger.info(embedCtx.executor().toString()); + if (embedCtx != null) + logger.info(embedCtx.executor().toString()); if ((tcpChannel == primaryChannel) && (primaryChannel == ctx.channel()))