From 5a6481dc6e87db089f93ef04bd03686916d42a88 Mon Sep 17 00:00:00 2001 From: Niki Roo Date: Tue, 26 May 2020 21:00:00 +0200 Subject: [PATCH] weblib: fix cover image close()d --- src/be/nikiroo/fanfix/library/WebLibrary.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/be/nikiroo/fanfix/library/WebLibrary.java b/src/be/nikiroo/fanfix/library/WebLibrary.java index 9af38e2..7381ae3 100644 --- a/src/be/nikiroo/fanfix/library/WebLibrary.java +++ b/src/be/nikiroo/fanfix/library/WebLibrary.java @@ -173,12 +173,12 @@ public class WebLibrary extends BasicLibrary { InputStream in = post(WebLibraryUrls.getStoryUrlCover(luid)); try { Image img = new Image(in); - if (img.getSize() > 0) { + if (img.getSize() == 0) { img.close(); - return img; + img = null; } - return null; + return img; } finally { in.close(); } @@ -189,12 +189,12 @@ public class WebLibrary extends BasicLibrary { InputStream in = post(WebLibraryUrls.getCoverUrlSource(source)); try { Image img = new Image(in); - if (img.getSize() > 0) { + if (img.getSize() == 0) { img.close(); - return img; + img = null; } - return null; + return img; } finally { in.close(); } @@ -205,12 +205,12 @@ public class WebLibrary extends BasicLibrary { InputStream in = post(WebLibraryUrls.getCoverUrlAuthor(author)); try { Image img = new Image(in); - if (img.getSize() > 0) { + if (img.getSize() == 0) { img.close(); - return img; + img = null; } - return null; + return img; } finally { in.close(); } -- 2.27.0