Skip to content

Commit b76942d

Browse files
authored
fix: handle null message in CustomPushNotification to prevent crashes (#6678)
1 parent 1977c48 commit b76942d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

android/app/src/main/java/chat/rocket/reactnative/notification/CustomPushNotification.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,9 @@ private void notificationChannel(Notification.Builder notification) {
241241
}
242242

243243
private String extractMessage(String message, Ejson ejson) {
244+
if (message == null) {
245+
return "";
246+
}
244247
if (ejson != null && ejson.type != null && !ejson.type.equals("d")) {
245248
int pos = message.indexOf(":");
246249
int start = pos == -1 ? 0 : pos + 2;

0 commit comments

Comments
 (0)