Skip to content

Commit 8ebe2b4

Browse files
Don't crash SDK is socket.close() fails
1 parent 0fa174c commit 8ebe2b4

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

firebase-database/CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
# 19.5.1 (Unreleased)
1+
# Unreleased
2+
- [fixed] Fixed a crash on some Pixel devices that occurred when closing the
3+
network connection.
4+
5+
# 19.5.1
26
- [fixed] Fixes a regression in v19.4 that may cause assertion failures,
37
especially when persistence is enabled.
48

firebase-database/src/main/java/com/google/firebase/database/tubesock/WebSocket.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,8 +261,8 @@ private synchronized void closeSocket() {
261261
if (socket != null) {
262262
try {
263263
socket.close();
264-
} catch (IOException e) {
265-
throw new RuntimeException(e);
264+
} catch (Throwable e) {
265+
eventHandler.onError(new WebSocketException("Failed to close", e));
266266
}
267267
}
268268
state = State.DISCONNECTED;

0 commit comments

Comments
 (0)