From b3cab6704958c89f83801d42bd6a963637c2b7df Mon Sep 17 00:00:00 2001 From: sk Date: Thu, 20 Jul 2023 23:43:46 +0200 Subject: [PATCH] fix null pointer when accessing draft content type closes sk22#734 --- .../org/joinmastodon/android/fragments/ComposeFragment.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/ComposeFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/ComposeFragment.java index b2acbd218..ebebed5bf 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/ComposeFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/ComposeFragment.java @@ -449,7 +449,7 @@ public class ComposeFragment extends MastodonToolbarFragment implements OnBackPr } else if (getArguments().containsKey("sourceContentType")) { try { String val = getArguments().getString("sourceContentType"); - contentType = val == null ? null : ContentType.valueOf(val); + if (val != null) contentType = ContentType.valueOf(val); } catch (IllegalArgumentException ignored) {} }