From c9cc8e23c1f4b72ac824e89167b6c857188ee58f Mon Sep 17 00:00:00 2001 From: sk Date: Mon, 9 Jan 2023 10:30:49 +0100 Subject: [PATCH] don't add subject if blank closes #240 --- .../java/org/joinmastodon/android/ExternalShareActivity.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mastodon/src/main/java/org/joinmastodon/android/ExternalShareActivity.java b/mastodon/src/main/java/org/joinmastodon/android/ExternalShareActivity.java index c289bde53..263af871c 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/ExternalShareActivity.java +++ b/mastodon/src/main/java/org/joinmastodon/android/ExternalShareActivity.java @@ -53,7 +53,10 @@ public class ExternalShareActivity extends FragmentStackActivity{ Intent intent=getIntent(); StringBuilder builder=new StringBuilder(); String subject = ""; - if (intent.hasExtra(Intent.EXTRA_SUBJECT)) builder.append(subject = intent.getStringExtra(Intent.EXTRA_SUBJECT)).append("\n\n"); + if (intent.hasExtra(Intent.EXTRA_SUBJECT)) { + subject = intent.getStringExtra(Intent.EXTRA_SUBJECT); + if (!subject.isBlank()) builder.append(subject).append("\n\n"); + } if (intent.hasExtra(Intent.EXTRA_TEXT)) builder.append(intent.getStringExtra(Intent.EXTRA_TEXT)).append("\n"); String text=builder.toString(); List mediaUris;