From abea2d0bdf6bf27bc48143c96e94ac2e4bfa2a83 Mon Sep 17 00:00:00 2001 From: Moxie Marlinspike Date: Tue, 1 Aug 2017 10:00:55 -0700 Subject: [PATCH] Fix for MediaOverviewActivity NPE // FREEBIE --- src/org/thoughtcrime/securesms/MediaOverviewActivity.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/org/thoughtcrime/securesms/MediaOverviewActivity.java b/src/org/thoughtcrime/securesms/MediaOverviewActivity.java index 8673fbb616..a7b6e7623c 100644 --- a/src/org/thoughtcrime/securesms/MediaOverviewActivity.java +++ b/src/org/thoughtcrime/securesms/MediaOverviewActivity.java @@ -24,6 +24,7 @@ import android.database.Cursor; import android.os.Build.VERSION; import android.os.Build.VERSION_CODES; import android.os.Bundle; +import android.os.Parcelable; import android.support.annotation.NonNull; import android.support.v4.app.LoaderManager; import android.support.v4.content.Loader; @@ -132,10 +133,10 @@ public class MediaOverviewActivity extends PassphraseRequiredActionBarActivity i gridView.setLayoutManager(gridManager); gridView.setHasFixedSize(true); - Address[] addresses = Address.fromParcelable(getIntent().getParcelableArrayExtra(ADDRESSES_EXTRA)); + Parcelable[] parcelables = getIntent().getParcelableArrayExtra(ADDRESSES_EXTRA); - if (addresses != null) { - recipients = RecipientFactory.getRecipientsFor(this, addresses, true); + if (parcelables != null) { + recipients = RecipientFactory.getRecipientsFor(this, Address.fromParcelable(parcelables), true); } else if (threadId > -1) { recipients = DatabaseFactory.getThreadDatabase(this).getRecipientsForThreadId(threadId); } else {