Skip to content

Commit

Permalink
Merge pull request #199 from learningequality/catch_notifications_if_…
Browse files Browse the repository at this point in the history
…you_can

Wrap notification updates in try catch to avoid errors
  • Loading branch information
bjester authored Feb 12, 2024
2 parents 3376216 + 4f4c3b5 commit 979866f
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,12 @@ public static void updateProgress(
String id, String notificationTitle, String notificationText, int progress, int total
) {
NotificationRef ref = Worker.buildNotificationRef(id);
Manager manager = new Manager(ContextUtil.getApplicationContext(), ref);
manager.send(notificationTitle, notificationText, progress, total);
try {
Context context = ContextUtil.getApplicationContext();
Manager manager = new Manager(context, ref);
manager.send(notificationTitle, notificationText, progress, total);
} catch (Exception e) {
Log.e(TAG, "Failed to update progress", e);
}
}
}

0 comments on commit 979866f

Please sign in to comment.