From 15534ad42e2b43fa43fb2bdf18c68662664fcaed 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 e68eaea6d..32d7c74cd 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/ExternalShareActivity.java +++ b/mastodon/src/main/java/org/joinmastodon/android/ExternalShareActivity.java @@ -49,7 +49,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;