Browse Source

Handle null client context for action log direct items

renovate/org.robolectric-robolectric-4.x
Ammar Githam 4 years ago
parent
commit
093ccc9f00
  1. 10
      app/src/main/java/awais/instagrabber/adapters/DirectItemsAdapter.java

10
app/src/main/java/awais/instagrabber/adapters/DirectItemsAdapter.java

@ -70,7 +70,15 @@ public final class DirectItemsAdapter extends RecyclerView.Adapter<RecyclerView.
return oldItem.date.equals(newItem.date);
}
if (oldItem.item != null && newItem.item != null) {
return oldItem.item.getClientContext().equals(newItem.item.getClientContext());
String oldClientContext = oldItem.item.getClientContext();
if (oldClientContext == null) {
oldClientContext = oldItem.item.getItemId();
}
String newClientContext = newItem.item.getClientContext();
if (newClientContext == null) {
newClientContext = newItem.item.getItemId();
}
return oldClientContext.equals(newClientContext);
}
return false;
}

Loading…
Cancel
Save