Merge pull request #119 from Winter-is-comingXK/4.0-dev

修复在api低于24的机器上加载帖子内容出错的bug
This commit is contained in:
HuanCheng65 2022-08-01 10:13:34 +08:00 committed by GitHub
commit 42c8a3103d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -15,11 +15,11 @@ public class ContentMsgAdapter implements JsonDeserializer<List<ThreadContentBea
public List<ThreadContentBean.ContentBean> deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException {
List<ThreadContentBean.ContentBean> list = new ArrayList<>();
if (json.isJsonArray()) {
json.getAsJsonArray().forEach(element -> {
for (JsonElement element : json.getAsJsonArray()) {
if (element.isJsonObject()) {
list.add(context.deserialize(element, ThreadContentBean.ContentBean.class));
}
});
}
}
return list;