diff options
author | Thomas <tschneider.ac@gmail.com> | 2023-01-11 18:22:29 +0100 |
---|---|---|
committer | Thomas <tschneider.ac@gmail.com> | 2023-01-11 18:22:29 +0100 |
commit | 8162e3f171ccaada1bf2258453e93808a854dd43 (patch) | |
tree | 0197125ad53a978026d6262fdb4e8509ec05534c /app/src | |
parent | 316e750004468ce2013b039182c60b978df34e9b (diff) |
Some fixes
Diffstat (limited to 'app/src')
-rw-r--r-- | app/src/main/java/app/fedilab/android/ui/drawer/StatusAdapter.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/app/src/main/java/app/fedilab/android/ui/drawer/StatusAdapter.java b/app/src/main/java/app/fedilab/android/ui/drawer/StatusAdapter.java index dbde407b0..baa1a162c 100644 --- a/app/src/main/java/app/fedilab/android/ui/drawer/StatusAdapter.java +++ b/app/src/main/java/app/fedilab/android/ui/drawer/StatusAdapter.java @@ -1280,7 +1280,9 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> public void onGlobalLayout() { holder.binding.mediaContainer.getViewTreeObserver().removeOnGlobalLayoutListener(this); measuredWidth = holder.binding.mediaContainer.getWidth(); - adapter.notifyItemChanged(0, statusList.size()); + if (adapter != null && statusList != null) { + adapter.notifyItemChanged(0, statusList.size()); + } } }); } @@ -1294,7 +1296,9 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> holder.binding.displayMedia.setVisibility(View.VISIBLE); holder.binding.displayMedia.setOnClickListener(v -> { statusToDeal.canLoadMedia = true; - adapter.notifyItemChanged(holder.getBindingAdapterPosition()); + if (adapter != null) { + adapter.notifyItemChanged(holder.getBindingAdapterPosition()); + } }); } else { int mediaPosition = 1; |