Avoid crashing with NPE when creating exception message

This commit is contained in:
cketti 2016-12-09 04:59:52 +01:00
parent ac55279b8e
commit 68e3c2a431

View file

@ -54,10 +54,10 @@ public class MessageExtractor {
part.isMimeType("application/pgp")) {
return getTextFromTextPart(part, body, mimeType, textSizeLimit);
} else {
throw new MessagingException("Provided non-text part: " + part);
throw new MessagingException("Provided non-text part: " + mimeType);
}
} else {
throw new MessagingException("Provided invalid part: " + part);
throw new MessagingException("Provided invalid part");
}
} catch (IOException e) {
Log.e(LOG_TAG, "Unable to getTextFromPart", e);