From fb01127ff2c95f6fa5f86a77956ca2d68afad9a9 Mon Sep 17 00:00:00 2001 From: agnostic-apollo Date: Mon, 28 Oct 2024 12:45:39 +0500 Subject: [PATCH] Fixed: Fix tests added in b84dc703 --- .../main/java/com/termux/app/api/file/FileReceiverActivity.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/src/main/java/com/termux/app/api/file/FileReceiverActivity.java b/app/src/main/java/com/termux/app/api/file/FileReceiverActivity.java index 3ce524f6b2..ca5c07407c 100644 --- a/app/src/main/java/com/termux/app/api/file/FileReceiverActivity.java +++ b/app/src/main/java/com/termux/app/api/file/FileReceiverActivity.java @@ -55,6 +55,8 @@ public class FileReceiverActivity extends AppCompatActivity { private static final String LOG_TAG = "FileReceiverActivity"; static boolean isSharedTextAnUrl(String sharedText) { + if (sharedText == null || sharedText.isEmpty()) return false; + return Patterns.WEB_URL.matcher(sharedText).matches() || Pattern.matches("magnet:\\?xt=urn:btih:.*?", sharedText); }