do not allow empty cover images
[fanfix.git] / src / be / nikiroo / fanfix / supported / BasicSupport_Deprecated.java
index a50ee3cf48a962a38b5ebe52b33184c956169ffd..40ff3fc027c7e52beca3426017e1a6a58972fbbe 100644 (file)
@@ -651,7 +651,13 @@ public abstract class BasicSupport_Deprecated extends BasicSupport {
                        InputStream in = null;
                        try {
                                in = Instance.getInstance().getCache().open(url, getSupport(url), true);
-                               return new Image(in);
+                               Image img = new Image(in);
+                               if (img.getSize() == 0) {
+                                       img.close();
+                                       throw new IOException(
+                                                       "Empty image not accepted");
+                               }
+                               return img;
                        } catch (IOException e) {
                        } finally {
                                if (in != null) {