From 2ef7d97f4e56eb23c964d333c90f15e646813386 Mon Sep 17 00:00:00 2001 From: Diego Mello Date: Wed, 24 Sep 2025 10:20:28 -0300 Subject: [PATCH] fix: handle null message in CustomPushNotification to prevent crashes --- .../reactnative/notification/CustomPushNotification.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/android/app/src/main/java/chat/rocket/reactnative/notification/CustomPushNotification.java b/android/app/src/main/java/chat/rocket/reactnative/notification/CustomPushNotification.java index 13de2befe0..2a1e13273b 100644 --- a/android/app/src/main/java/chat/rocket/reactnative/notification/CustomPushNotification.java +++ b/android/app/src/main/java/chat/rocket/reactnative/notification/CustomPushNotification.java @@ -241,6 +241,9 @@ private void notificationChannel(Notification.Builder notification) { } private String extractMessage(String message, Ejson ejson) { + if (message == null) { + return ""; + } if (ejson != null && ejson.type != null && !ejson.type.equals("d")) { int pos = message.indexOf(":"); int start = pos == -1 ? 0 : pos + 2;