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 2021/12/03 10:29:31 UTC

[plc4x] branch develop updated: fix(plc4j/netty): fix NPE on failed connection

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


The following commit(s) were added to refs/heads/develop by this push:
     new 6b26af6  fix(plc4j/netty): fix NPE on failed connection
6b26af6 is described below

commit 6b26af607bd6d89e8458cea236c64cc95448148e
Author: Sebastian Rühl <sr...@apache.org>
AuthorDate: Fri Dec 3 11:29:05 2021 +0100

    fix(plc4j/netty): fix NPE on failed connection
---
 .../org/apache/plc4x/java/spi/connection/NettyChannelFactory.java     | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/connection/NettyChannelFactory.java b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/connection/NettyChannelFactory.java
index 14b1afe..caedca7 100644
--- a/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/connection/NettyChannelFactory.java
+++ b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/connection/NettyChannelFactory.java
@@ -110,7 +110,9 @@ public abstract class NettyChannelFactory implements ChannelFactory {
             f.addListener(future -> {
                 if (!future.isSuccess()) {
                     logger.info("Unable to connect, shutting down worker thread.");
-                    workerGroup.shutdownGracefully();
+                    if (workerGroup != null) {
+                        workerGroup.shutdownGracefully();
+                    }
                 }
             });