added instanceof check on Multipart content.
@@ -136,7 +136,11 @@ private void outputBodyPart(
if (SMIMEUtil.isMultipartContent(mimePart))
{
- Multipart mp = (Multipart)mimePart.getContent();
+ Object content = mimePart.getContent();
+
+ if (content instanceof Multipart)
+ {
+ Multipart mp = (Multipart)content;
ContentType contentType = new ContentType(mp.getContentType());
String boundary = "--" + contentType.getParameter("boundary");
@@ -155,6 +159,7 @@ private void outputBodyPart(
outputBodyPart(out, mp);
return;
}
+ }
mimePart.writeTo(out);
}
