From 83311b7f080b1ce2bc29cd56531fb8e46164bd38 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 2647d235..6098263c 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 5385dd4a..0b9ae361 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: