summaryrefslogtreecommitdiff
path: root/jurt/com/sun/star/lib/connections/socket/socketConnector.java
diff options
context:
space:
mode:
Diffstat (limited to 'jurt/com/sun/star/lib/connections/socket/socketConnector.java')
-rw-r--r--jurt/com/sun/star/lib/connections/socket/socketConnector.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/jurt/com/sun/star/lib/connections/socket/socketConnector.java b/jurt/com/sun/star/lib/connections/socket/socketConnector.java
index e88f1040ac16..3d29e47f4f21 100644
--- a/jurt/com/sun/star/lib/connections/socket/socketConnector.java
+++ b/jurt/com/sun/star/lib/connections/socket/socketConnector.java
@@ -154,9 +154,11 @@ public final class socketConnector implements XConnector {
con = new SocketConnection(connectionDescription, socket);
} catch (IOException e) {
- try {
- socket.close();
- } catch(IOException ioException) {
+ if (socket != null) {
+ try {
+ socket.close();
+ } catch(IOException ioException) {
+ }
}
throw new NoConnectException(e);
}