From 8a1a47e7736e311d679c38cdfb1417e17e420bd0 Mon Sep 17 00:00:00 2001 From: Greyson Parrelli Date: Tue, 27 Nov 2018 09:32:56 -0800 Subject: [PATCH] Fix MediaPreview NPE. --- src/org/thoughtcrime/securesms/MediaPreviewActivity.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/org/thoughtcrime/securesms/MediaPreviewActivity.java b/src/org/thoughtcrime/securesms/MediaPreviewActivity.java index 9af32fe3cf..af002c0263 100644 --- a/src/org/thoughtcrime/securesms/MediaPreviewActivity.java +++ b/src/org/thoughtcrime/securesms/MediaPreviewActivity.java @@ -241,7 +241,7 @@ public class MediaPreviewActivity extends PassphraseRequiredActionBarActivity im private void initializeObservers() { viewModel.getPreviewData().observe(this, previewData -> { - if (previewData == null) { + if (previewData == null || mediaPager == null || mediaPager.getAdapter() == null) { return; }