Only add a new plain-text part if there is any text in front of the link.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 9 Jun 2011 10:15:33 +0000 (12:15 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 9 Jun 2011 10:15:33 +0000 (12:15 +0200)
src/main/java/net/pterodactylus/sone/text/SoneTextParser.java

index 2787d52..94c3db4 100644 (file)
@@ -225,7 +225,9 @@ public class SoneTextParser implements Parser<SoneTextParserContext> {
                                        if (!lastLineEmpty && lineComplete) {
                                                parts.add(new PlainTextPart("\n" + line.substring(0, next)));
                                        } else {
-                                               parts.add(new PlainTextPart(line.substring(0, next)));
+                                               if (next > 0) {
+                                                       parts.add(new PlainTextPart(line.substring(0, next)));
+                                               }
                                        }
                                        String link = line.substring(next, nextSpace);
                                        String name = link;