From: David ‘Bombe’ Roden Date: Wed, 8 Jun 2011 09:45:32 +0000 (+0200) Subject: Don’t throw away the last part if it’s not a plain-text part. X-Git-Tag: 0.6.5^2~9^2~13 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=e59ee02b2d762326da7a8d35f483390630eb77a9;p=Sone.git Don’t throw away the last part if it’s not a plain-text part. --- diff --git a/src/main/java/net/pterodactylus/sone/text/SoneTextParser.java b/src/main/java/net/pterodactylus/sone/text/SoneTextParser.java index 6336934..dede0ac 100644 --- a/src/main/java/net/pterodactylus/sone/text/SoneTextParser.java +++ b/src/main/java/net/pterodactylus/sone/text/SoneTextParser.java @@ -294,7 +294,7 @@ public class SoneTextParser implements Parser { } 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);