Skip to content

Commit 00e6a8d

Browse files
Don't crash SDK is socket.close() fails (#2216)
1 parent 141830d commit 00e6a8d

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

firebase-database/CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
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+
- [added] Added `Query.get()`, which allows users to receive a single data
5+
snapshot. `Query.get()` returns the latest value even if an older value
6+
already exists in cache.
7+
8+
# 19.5.1
29
- [fixed] Fixes a regression in v19.4 that may cause assertion failures,
310
especially when persistence is enabled.
411

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 (Exception e) {
265+
eventHandler.onError(new WebSocketException("Failed to close", e));
266266
}
267267
}
268268
state = State.DISCONNECTED;

0 commit comments

Comments
 (0)