From 8a2caeef3d344b50372c4ae472f6939680dc3e07 Mon Sep 17 00:00:00 2001 From: Moxie Marlinspike Date: Fri, 20 Feb 2015 12:38:26 -0800 Subject: [PATCH] Fix for OKH IllegalStateException. // FREEBIE Fixes #2501 --- .../internal/websocket/WebSocketConnection.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libtextsecure/src/main/java/org/whispersystems/textsecure/internal/websocket/WebSocketConnection.java b/libtextsecure/src/main/java/org/whispersystems/textsecure/internal/websocket/WebSocketConnection.java index 87ceb8c300..425a8a9dc7 100644 --- a/libtextsecure/src/main/java/org/whispersystems/textsecure/internal/websocket/WebSocketConnection.java +++ b/libtextsecure/src/main/java/org/whispersystems/textsecure/internal/websocket/WebSocketConnection.java @@ -188,7 +188,13 @@ public class WebSocketConnection { while (newSocket()) { try { - Response response = webSocket.connect(Client.this); + Response response; + + try { + response = webSocket.connect(Client.this); + } catch (IllegalStateException e) { + throw new IOException(e); + } if (response.code() == 101) { onConnected();