From cccd15e4dc1ba769727fdfeb3359c2307f3e8ac6 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Sun, 18 Sep 2016 22:15:02 +0200 Subject: don't simply ignore null in message body but try to avoid it --- src/main/java/de/pixart/messenger/crypto/PgpDecryptionService.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/main/java/de/pixart/messenger/crypto') diff --git a/src/main/java/de/pixart/messenger/crypto/PgpDecryptionService.java b/src/main/java/de/pixart/messenger/crypto/PgpDecryptionService.java index 02c094b71..b3f2e64da 100644 --- a/src/main/java/de/pixart/messenger/crypto/PgpDecryptionService.java +++ b/src/main/java/de/pixart/messenger/crypto/PgpDecryptionService.java @@ -115,7 +115,11 @@ public class PgpDecryptionService { case OpenPgpApi.RESULT_CODE_SUCCESS: try { os.flush(); - message.setBody(os.toString()); + final String body = os.toString(); + if (body == null) { + throw new IOException("body was null"); + } + message.setBody(body); message.setEncryption(Message.ENCRYPTION_DECRYPTED); final HttpConnectionManager manager = mXmppConnectionService.getHttpConnectionManager(); if (message.trusted() -- cgit v1.2.3