Skip to content

Commit 1768598

Browse files
committed
Merge pull request #37 from Leanplum/feature/fix-LP-4789
fix(NPE) wrapping creation notification in try{}catch block to avoid …
1 parent ec661d0 commit 1768598

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

AndroidSDK/src/com/leanplum/LeanplumPushService.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,15 @@ private static void showNotification(Context context, Bundle message) {
346346
notificationId = value.hashCode();
347347
}
348348
}
349-
notificationManager.notify(notificationId, builder.build());
349+
350+
try {
351+
notificationManager.notify(notificationId, builder.build());
352+
} catch (NullPointerException e) {
353+
Log.e("Unable to show push notification.", e);
354+
} catch (Throwable t) {
355+
Log.e("Unable to show push notification.", t);
356+
Util.handleException(t);
357+
}
350358
}
351359

352360
static void openNotification(Context context, final Bundle notification) {

0 commit comments

Comments
 (0)