diff --git a/android/app/src/main/java/com/mattermost/rnbeta/CustomPushNotification.java b/android/app/src/main/java/com/mattermost/rnbeta/CustomPushNotification.java index 4e00f8be2..25545d8c6 100644 --- a/android/app/src/main/java/com/mattermost/rnbeta/CustomPushNotification.java +++ b/android/app/src/main/java/com/mattermost/rnbeta/CustomPushNotification.java @@ -210,9 +210,15 @@ public class CustomPushNotification extends PushNotification { String summaryTitle = String.format("%s (%d)", title, numMessages); Notification.InboxStyle style = new Notification.InboxStyle(); - List list = new ArrayList(channelIdToNotification.get(channelId)); + List bundleArray = channelIdToNotification.get(channelId); + List list; + if (bundleArray != null) { + list = new ArrayList(bundleArray); + } else { + list = new ArrayList(); + } - for (Bundle data : list){ + for (Bundle data : list) { String msg = data.getString("message"); if (msg != message) { style.addLine(data.getString("message"));