update from master
[fanfix.git] / supported / FimfictionApi.java
index 43d01d19494f616c6811e5757da4a6f2e14c83cc..e6dd6118721b93aec36c0d7c734faad1c6d9a95b 100644 (file)
@@ -147,7 +147,13 @@ class FimfictionApi extends BasicSupport {
                        try {
                                InputStream in = Instance.getInstance().getCache().open(coverImageUrl, null, true);
                                try {
-                                       meta.setCover(new Image(in));
+                                       Image img = new Image(in);
+                                       if (img.getSize() == 0) {
+                                               img.close();
+                                               throw new IOException(
+                                                               "Empty image not accepted");
+                                       }
+                                       meta.setCover(img);
                                } finally {
                                        in.close();
                                }