From e59ee02b2d762326da7a8d35f483390630eb77a9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Wed, 8 Jun 2011 11:45:32 +0200 Subject: [PATCH] =?utf8?q?Don=E2=80=99t=20throw=20away=20the=20last=20part?= =?utf8?q?=20if=20it=E2=80=99s=20not=20a=20plain-text=20part.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/main/java/net/pterodactylus/sone/text/SoneTextParser.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- 2.7.4