From e6fffc0d5ba5e3829247febb123fa1b7cae77a6a Mon Sep 17 00:00:00 2001 From: Robin Date: Fri, 8 Oct 2021 21:42:01 +0200 Subject: [PATCH] Fix crash on missing title when sharing livestream --- .../schabi/newpipe/util/external_communication/ShareUtils.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/schabi/newpipe/util/external_communication/ShareUtils.java b/app/src/main/java/org/schabi/newpipe/util/external_communication/ShareUtils.java index 22ab6cf2b..c4f1675cf 100644 --- a/app/src/main/java/org/schabi/newpipe/util/external_communication/ShareUtils.java +++ b/app/src/main/java/org/schabi/newpipe/util/external_communication/ShareUtils.java @@ -9,6 +9,7 @@ import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; import android.net.Uri; import android.os.Build; +import android.text.TextUtils; import android.widget.Toast; import androidx.annotation.NonNull; @@ -246,7 +247,7 @@ public final class ShareUtils { final Intent shareIntent = new Intent(Intent.ACTION_SEND); shareIntent.setType("text/plain"); shareIntent.putExtra(Intent.EXTRA_TEXT, content); - if (!title.isEmpty()) { + if (!TextUtils.isEmpty(title)) { shareIntent.putExtra(Intent.EXTRA_TITLE, title); shareIntent.putExtra(Intent.EXTRA_SUBJECT, title); }