if (imageEntry) {
String uuid = meta.getUuid() + "_" + entry.getName();
try {
- images.put(uuid, new Image(zipIn));
+ Image img = new Image(zipIn);
+ if (img.getSize() == 0) {
+ img.close();
+ throw new IOException(
+ "Empty image not accepted");
+ }
+ images.put(uuid, img);
} catch (Exception e) {
Instance.getInstance().getTraceHandler().error(e);
}
}
if (!imagesList.isEmpty()) {
- Chapter chap = new Chapter(story.getChapters().size() + 1, null);
+ Chapter chap = new Chapter(story.getChapters().size() + 1, "");
story.getChapters().add(chap);
for (String uuid : imagesList) {