chore: wrap badge setting in try-catch block (#2134)
This commit is contained in:
parent
c6e5c2ad29
commit
4d149dd873
1 changed files with 12 additions and 4 deletions
|
|
@ -202,11 +202,19 @@ class BackgroundPush {
|
|||
final unreadCount = client.rooms
|
||||
.where((room) => room.isUnreadOrInvited && room.id != roomId)
|
||||
.length;
|
||||
if (unreadCount == 0) {
|
||||
FlutterNewBadger.removeBadge();
|
||||
} else {
|
||||
FlutterNewBadger.setBadge(unreadCount);
|
||||
// #Pangea
|
||||
try {
|
||||
// Pangea#
|
||||
if (unreadCount == 0) {
|
||||
FlutterNewBadger.removeBadge();
|
||||
} else {
|
||||
FlutterNewBadger.setBadge(unreadCount);
|
||||
}
|
||||
// #Pangea
|
||||
} catch (e, s) {
|
||||
ErrorHandler.logError(data: {}, e: e, s: s);
|
||||
}
|
||||
// Pangea#
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue