summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main/java/com/lumaserv/bgp/BGPSession.java3
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);