Skip to content

Commit cac0919

Browse files
committed
fix: android side get reactions of message null pointer error
1 parent a7bc427 commit cac0919

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

android/src/main/java/com/easemob/im_flutter_sdk/EMMessageWrapper.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,10 @@ private void reactionList(JSONObject params, String channelName, MethodChannel.R
5151
ArrayList<Map<String, Object>> list = new ArrayList<>();
5252
if (msg != null) {
5353
List<EMMessageReaction> reactions = msg.getMessageReaction();
54-
for (int i = 0; i < reactions.size(); i++) {
55-
list.add(EMMessageReactionHelper.toJson(reactions.get(i)));
54+
if (reactions != null) {
55+
for (int i = 0; i < reactions.size(); i++) {
56+
list.add(EMMessageReactionHelper.toJson(reactions.get(i)));
57+
}
5658
}
5759
}
5860
onSuccess(result, channelName, list);

0 commit comments

Comments
 (0)