Skip to content

Commit 4d149dd

Browse files
authored
chore: wrap badge setting in try-catch block (#2134)
1 parent c6e5c2a commit 4d149dd

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

lib/utils/background_push.dart

+12-4
Original file line numberDiff line numberDiff line change
@@ -202,11 +202,19 @@ class BackgroundPush {
202202
final unreadCount = client.rooms
203203
.where((room) => room.isUnreadOrInvited && room.id != roomId)
204204
.length;
205-
if (unreadCount == 0) {
206-
FlutterNewBadger.removeBadge();
207-
} else {
208-
FlutterNewBadger.setBadge(unreadCount);
205+
// #Pangea
206+
try {
207+
// Pangea#
208+
if (unreadCount == 0) {
209+
FlutterNewBadger.removeBadge();
210+
} else {
211+
FlutterNewBadger.setBadge(unreadCount);
212+
}
213+
// #Pangea
214+
} catch (e, s) {
215+
ErrorHandler.logError(data: {}, e: e, s: s);
209216
}
217+
// Pangea#
210218
return;
211219
}
212220
}

0 commit comments

Comments
 (0)