android: fix when flowlayout not set loadMoreView will crash

This commit is contained in:
pengfei.zhou 2021-09-30 15:40:08 +08:00 committed by osborn
parent 9757a6e8c6
commit 53452e1d53

View File

@ -62,7 +62,7 @@ class FlowAdapter extends RecyclerView.Adapter<FlowAdapter.DoricViewHolder> {
@Override
public void onBindViewHolder(@NonNull DoricViewHolder holder, int position) {
JSValue jsValue = getItemModel(position);
if (jsValue.isObject()) {
if (jsValue != null && jsValue.isObject()) {
JSObject jsObject = jsValue.asObject();
holder.flowLayoutItemNode.setId(jsObject.getProperty("id").asString().value());
holder.flowLayoutItemNode.blend(jsObject.getProperty("props").asObject());