From 0be790dcad21dc950e803f71185f78ed2e505985 Mon Sep 17 00:00:00 2001 From: Vincent Breitmoser Date: Sat, 20 Jun 2015 21:34:21 +0200 Subject: [PATCH] fix display of signed-only content --- .../keychain/ui/DecryptListFragment.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptListFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptListFragment.java index 1366e5563..dfe2d07aa 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptListFragment.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptListFragment.java @@ -19,7 +19,6 @@ package org.sufficientlysecure.keychain.ui; import java.io.File; -import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -592,14 +591,18 @@ public class DecryptListFragment OpenPgpMetadata metadata = model.mResult.getDecryptMetadata(); - String filename = metadata.getFilename(); - if (TextUtils.isEmpty(filename)) { + String filename; + if (metadata == null) { + filename = mContext.getString(R.string.filename_unknown); + } else if (TextUtils.isEmpty(metadata.getFilename())) { filename = mContext.getString("text/plain".equals(metadata.getMimeType()) ? R.string.filename_unknown_text : R.string.filename_unknown); + } else { + filename = metadata.getFilename(); } holder.vFilename.setText(filename); - long size = metadata.getOriginalSize(); + long size = metadata == null ? 0 : metadata.getOriginalSize(); if (size == -1 || size == 0) { holder.vFilesize.setText(""); } else {