Verify that an invalid image causes an error.
[Sone.git] / src / main / java / net / pterodactylus / sone / core / SoneParser.java
index 512da1b..2056c32 100644 (file)
@@ -282,7 +282,7 @@ public class SoneParser {
                                                String imageHeightString = imageXml.getValue("height", null);
                                                if ((imageId == null) || (imageCreationTimeString == null) || (imageKey == null) || (imageTitle == null) || (imageWidthString == null) || (imageHeightString == null)) {
                                                        logger.log(Level.WARNING, String.format("Downloaded Sone %s contains invalid images!", sone));
-                                                       return null;
+                                                       throw new MalformedXml();
                                                }
                                                long creationTime = Numbers.safeParseLong(imageCreationTimeString, 0L);
                                                int imageWidth = Numbers.safeParseInteger(imageWidthString, 0);