Skip to content

Commit 89ee2d3

Browse files
author
Kristijan Sedlak
committed
preventing crash on NullPointerException inside run()
1 parent 936adf8 commit 89ee2d3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/net/tootallnate/websocket/WebSocketClient.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,10 @@ public void run() {
218218
}
219219
} catch (IOException ex) {
220220
onIOError(conn, ex);
221-
} catch (NoSuchAlgorithmException ex) {
221+
} catch (Exception ex) {
222+
// NullPointerException is the most common error that can happen here
223+
// (e.g.when connection closes immediately)
224+
// TODO: user should handle that kind of events my himself
222225
ex.printStackTrace();
223226
}
224227
}

0 commit comments

Comments
 (0)