Throw exception when a post misses something vital.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 24 Oct 2013 21:05:09 +0000 (23:05 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 28 Feb 2014 21:25:36 +0000 (22:25 +0100)
src/main/java/net/pterodactylus/sone/core/SoneParser.java

index 7dc0744..210fe32 100644 (file)
@@ -173,7 +173,7 @@ public class SoneParser {
                                if ((postId == null) || (postTime == null) || (postText == null)) {
                                        /* TODO - mark Sone as bad. */
                                        logger.log(Level.WARNING, String.format("Downloaded post for Sone %s with missing data! ID: %s, Time: %s, Text: %s", sone, postId, postTime, postText));
-                                       return null;
+                                       throw new MalformedXml();
                                }
                                try {
                                        PostBuilder postBuilder = sone.newPostBuilder();