Skip to content

Conversation

@flowkscai
Copy link
Contributor

问题描述:

安卓下获取消息 Reaction 列表抛空指针异常

问题定位:

EMMessageWrapper.java

private void reactionList(JSONObject params, String channelName, MethodChannel.Result result) throws JSONException {
      String msgId = params.getString("msgId");
      EMMessage msg = getMessageWithId(msgId);
      ArrayList<Map<String, Object>> list = new ArrayList<>();
      if (msg != null) {
          List<EMMessageReaction> reactions = msg.getMessageReaction();  // <== 可能返回 null
          for (int i = 0; i < reactions.size(); i++) {
              list.add(EMMessageReactionHelper.toJson(reactions.get(i)));
          }
      }
      onSuccess(result, channelName, list);
  }

@dujiepeng dujiepeng merged commit 36473a0 into easemob:flutter2_stable Apr 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants