Skip to content

Commit 2753e8d

Browse files
AmirWienerAmir Wiener
andauthored
Prevent NPE in TcpSyslogMessageSender#close (#83)
Co-authored-by: Amir Wiener <[email protected]>
1 parent 2a4f7a5 commit 2753e8d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/main/java/com/cloudbees/syslog/sender/TcpSyslogMessageSender.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,8 @@ public String toString() {
288288

289289
@Override
290290
public void close() throws IOException {
291-
this.socket.close();
291+
if (socket != null) {
292+
this.socket.close();
293+
}
292294
}
293295
}

0 commit comments

Comments
 (0)