From 30ce89b9ee0c9e502df42f617600a96c26350cdb Mon Sep 17 00:00:00 2001 From: LightningRS <54468001+LightningRS@users.noreply.github.com> Date: Fri, 21 Oct 2022 17:02:26 +0800 Subject: [PATCH] Fix potential NPE in ShareActivity (#1839) --- .../nutomic/syncthingandroid/activities/ShareActivity.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/nutomic/syncthingandroid/activities/ShareActivity.java b/app/src/main/java/com/nutomic/syncthingandroid/activities/ShareActivity.java index a58a25f7..46bfc0f6 100644 --- a/app/src/main/java/com/nutomic/syncthingandroid/activities/ShareActivity.java +++ b/app/src/main/java/com/nutomic/syncthingandroid/activities/ShareActivity.java @@ -119,11 +119,11 @@ public class ShareActivity extends StateDialogActivity // TODO: add support for EXTRA_TEXT (notes, memos sharing) ArrayList extrasToCopy = new ArrayList<>(); - if (getIntent().getAction().equals(Intent.ACTION_SEND)) { + if (Intent.ACTION_SEND.equals(getIntent().getAction())) { Uri uri = getIntent().getParcelableExtra(Intent.EXTRA_STREAM); if (uri != null) extrasToCopy.add(uri); - } else if (getIntent().getAction().equals(Intent.ACTION_SEND_MULTIPLE)) { + } else if (Intent.ACTION_SEND_MULTIPLE.equals(getIntent().getAction())) { ArrayList extras = getIntent().getParcelableArrayListExtra(Intent.EXTRA_STREAM); if (extras != null) extrasToCopy = extras;