Merge t branch
authorNiki Roo <niki@nikiroo.be>
Thu, 25 Apr 2019 15:36:41 +0000 (17:36 +0200)
committerNiki Roo <niki@nikiroo.be>
Thu, 25 Apr 2019 15:36:41 +0000 (17:36 +0200)
branch 'master' of github.com:nikiroo/fanfix

src/be/nikiroo/fanfix/supported/FimfictionApi.java

index 887f5f9c121397a4b8e90d7023c8d1ffac073f9b..a64e4c082f4eccbe5e1ae9fcc88745306207a5fc 100644 (file)
@@ -145,10 +145,11 @@ class FimfictionApi extends BasicSupport {
                String coverImageLink = getKeyJson(json, 0, "type", "story",
                                "cover_image", "full");
                if (!coverImageLink.trim().isEmpty()) {
-                       InputStream in = null;
+                       URL coverImageUrl = new URL(coverImageLink.trim());
+
+                       InputStream in = Instance.getCache()
+                                       .open(coverImageUrl, this, true);
                        try {
-                               URL coverImageUrl = new URL(coverImageLink.trim());
-                               in = Instance.getCache().open(coverImageUrl, this, true);
                                meta.setCover(new Image(in));
                        } finally {
                                in.close();