teragrep / rlp_01

Java Reliable Event Logging Protocol (RELP) Library RLP-01
Apache License 2.0
5 stars 5 forks source link

teardown on never connected RelpConnection throws npe #63

Open kortemik opened 6 months ago

kortemik commented 6 months ago

Describe the bug

Cannot invoke "java.nio.channels.SocketChannel.close()" because "this.socketChannel" is null> java.lang.NullPointerException: Cannot invoke "java.nio.channels.SocketChannel.close()" because "this.socketChannel" is null
        at com.teragrep.rlp_01.RelpClientPlainSocket.close(RelpClientPlainSocket.java:150)
        at com.teragrep.rlp_01.RelpConnection.tearDown(RelpConnection.java:169)

when connection has never been connected

Expected behavior shouldn't throw, should just be no-op because there is nothing to teardown

How to reproduce create new RelpConnection and immediately call teardown() on it.

Screenshots

Software version 4.0.1

Desktop (please complete the following information if relevant):

Additional context