Throw malformed XML exception when fields can not be parsed.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 24 Oct 2013 20:58:40 +0000 (22:58 +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 ab05b97..04d095a 100644 (file)
@@ -147,7 +147,7 @@ public class SoneParser {
                                String fieldValue = fieldXml.getValue("field-value", "");
                                if (fieldName == null) {
                                        logger.log(Level.WARNING, String.format("Downloaded profile field for Sone %s with missing data! Name: %s, Value: %s", sone, fieldName, fieldValue));
-                                       return null;
+                                       throw new MalformedXml();
                                }
                                try {
                                        profile.setField(profile.addField(fieldName), fieldValue);