Change all copyright headers to include 2012.
[Sone.git] / src / main / java / net / pterodactylus / sone / text / SoneTextParser.java
index 051c02a..507523a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Sone - FreenetLinkParser.java - Copyright © 2010 David Roden
+ * Sone - FreenetLinkParser.java - Copyright © 2010–2012 David Roden
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -202,11 +202,14 @@ public class SoneTextParser implements Parser<SoneTextParserContext> {
                                        if (line.length() >= (7 + 43)) {
                                                String soneId = line.substring(7, 50);
                                                Sone sone = soneProvider.getSone(soneId, false);
-                                               if ((sone != null) && (sone.getName() != null)) {
-                                                       parts.add(new SonePart(sone));
-                                               } else {
-                                                       parts.add(new PlainTextPart(line.substring(0, 50)));
+                                               if (sone == null) {
+                                                       /*
+                                                        * don’t use create=true above, we don’t want the
+                                                        * empty shell.
+                                                        */
+                                                       sone = new Sone(soneId);
                                                }
+                                               parts.add(new SonePart(sone));
                                                line = line.substring(50);
                                        } else {
                                                parts.add(new PlainTextPart(line));