From c04c51ce4174a3c20d99eeffd7bf55630a62e869 Mon Sep 17 00:00:00 2001 From: Konrad Pozniak Date: Thu, 12 Sep 2019 20:03:07 +0200 Subject: [PATCH] fix crash because of null visibility (#1478) * fix crash because of null visibility * fix crash because of null visibility --- .../com/keylesspalace/tusky/adapter/StatusBaseViewHolder.java | 4 ++++ .../keylesspalace/tusky/adapter/StatusDetailedViewHolder.java | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/app/src/main/java/com/keylesspalace/tusky/adapter/StatusBaseViewHolder.java b/app/src/main/java/com/keylesspalace/tusky/adapter/StatusBaseViewHolder.java index 2647d235a..6098263c7 100644 --- a/app/src/main/java/com/keylesspalace/tusky/adapter/StatusBaseViewHolder.java +++ b/app/src/main/java/com/keylesspalace/tusky/adapter/StatusBaseViewHolder.java @@ -729,6 +729,10 @@ public abstract class StatusBaseViewHolder extends RecyclerView.ViewHolder { private static CharSequence getVisibilityDescription(Context context, Status.Visibility visibility) { + if(visibility == null) { + return ""; + } + int resource; switch (visibility) { case PUBLIC: diff --git a/app/src/main/java/com/keylesspalace/tusky/adapter/StatusDetailedViewHolder.java b/app/src/main/java/com/keylesspalace/tusky/adapter/StatusDetailedViewHolder.java index 5385dd4a2..0b9ae3614 100644 --- a/app/src/main/java/com/keylesspalace/tusky/adapter/StatusDetailedViewHolder.java +++ b/app/src/main/java/com/keylesspalace/tusky/adapter/StatusDetailedViewHolder.java @@ -221,6 +221,10 @@ class StatusDetailedViewHolder extends StatusBaseViewHolder { private void setStatusVisibility(Status.Visibility visibility) { + if(visibility == null) { + return; + } + int visibilityIcon; switch (visibility) { case PUBLIC: