From: David ‘Bombe’ Roden Date: Thu, 24 Oct 2013 20:58:40 +0000 (+0200) Subject: Throw malformed XML exception when fields can not be parsed. X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=693ff1bb4d56f2a674c25bbe4cc2363419ebe10e;p=Sone.git Throw malformed XML exception when fields can not be parsed. --- diff --git a/src/main/java/net/pterodactylus/sone/core/SoneParser.java b/src/main/java/net/pterodactylus/sone/core/SoneParser.java index ab05b97..04d095a 100644 --- a/src/main/java/net/pterodactylus/sone/core/SoneParser.java +++ b/src/main/java/net/pterodactylus/sone/core/SoneParser.java @@ -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);