diff options
author | Mikael Magnusson <mikma@users.sourceforge.net> | 2023-11-10 23:01:10 +0100 |
---|---|---|
committer | Mikael Magnusson <mikma@users.sourceforge.net> | 2023-11-12 17:40:46 +0100 |
commit | 8f07e17d9263ebcbb4766edec3d62797f6f13550 (patch) | |
tree | 2387b2f314c387d9b597b600f8532152c1563bb3 | |
parent | d2fdb1697dfcd67540553a2933daa7f63da20d0d (diff) |
Fix socket null exception
-rw-r--r-- | src/main/java/com/lumaserv/bgp/BGPSession.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/main/java/com/lumaserv/bgp/BGPSession.java b/src/main/java/com/lumaserv/bgp/BGPSession.java index bd40c13..f8ccd7c 100644 --- a/src/main/java/com/lumaserv/bgp/BGPSession.java +++ b/src/main/java/com/lumaserv/bgp/BGPSession.java @@ -192,7 +192,8 @@ System.out.println("Sent open"); outputStream.close(); if (inputStream != null) inputStream.close(); - socket.close(); + if (socket != null) + socket.close(); } catch (IOException ex) { ex.printStackTrace(); throw new RuntimeException(ex); |