Don’t throw away the last part if it’s not a plain-text part.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 8 Jun 2011 09:45:32 +0000 (11:45 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 8 Jun 2011 09:45:32 +0000 (11:45 +0200)
src/main/java/net/pterodactylus/sone/text/SoneTextParser.java

index 6336934..dede0ac 100644 (file)
@@ -294,7 +294,7 @@ public class SoneTextParser implements Parser<SoneTextParserContext> {
                }
                for (int partIndex = parts.size() - 1; partIndex >= 0; --partIndex) {
                        Part part = parts.getPart(partIndex);
-                       if ((part instanceof PlainTextPart) && !"\n".equals(((PlainTextPart) part).getText())) {
+                       if (!(part instanceof PlainTextPart) || !"\n".equals(((PlainTextPart) part).getText())) {
                                break;
                        }
                        parts.removePart(partIndex);