1
0
Fork 0
mirror of https://github.com/syncthing/syncthing-android.git synced 2024-12-23 11:21:29 +00:00

Fix potential NPE in ShareActivity (#1839)

This commit is contained in:
LightningRS 2022-10-21 17:02:26 +08:00 committed by GitHub
parent fb5ba8b73e
commit 30ce89b9ee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -119,11 +119,11 @@ public class ShareActivity extends StateDialogActivity
// TODO: add support for EXTRA_TEXT (notes, memos sharing) // TODO: add support for EXTRA_TEXT (notes, memos sharing)
ArrayList<Uri> extrasToCopy = new ArrayList<>(); ArrayList<Uri> extrasToCopy = new ArrayList<>();
if (getIntent().getAction().equals(Intent.ACTION_SEND)) { if (Intent.ACTION_SEND.equals(getIntent().getAction())) {
Uri uri = getIntent().getParcelableExtra(Intent.EXTRA_STREAM); Uri uri = getIntent().getParcelableExtra(Intent.EXTRA_STREAM);
if (uri != null) if (uri != null)
extrasToCopy.add(uri); extrasToCopy.add(uri);
} else if (getIntent().getAction().equals(Intent.ACTION_SEND_MULTIPLE)) { } else if (Intent.ACTION_SEND_MULTIPLE.equals(getIntent().getAction())) {
ArrayList<Uri> extras = getIntent().getParcelableArrayListExtra(Intent.EXTRA_STREAM); ArrayList<Uri> extras = getIntent().getParcelableArrayListExtra(Intent.EXTRA_STREAM);
if (extras != null) if (extras != null)
extrasToCopy = extras; extrasToCopy = extras;