git://git.nikiroo.be
/
fanfix-jexer.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7e51d91
)
FanfictionApi: fix NPE
author
Niki Roo
<niki@nikiroo.be>
Tue, 23 Apr 2019 17:01:07 +0000
(19:01 +0200)
committer
Niki Roo
<niki@nikiroo.be>
Tue, 23 Apr 2019 17:01:07 +0000
(19:01 +0200)
src/be/nikiroo/fanfix/supported/FimfictionApi.java
patch
|
blob
|
blame
|
history
diff --git
a/src/be/nikiroo/fanfix/supported/FimfictionApi.java
b/src/be/nikiroo/fanfix/supported/FimfictionApi.java
index 887f5f9c121397a4b8e90d7023c8d1ffac073f9b..a64e4c082f4eccbe5e1ae9fcc88745306207a5fc 100644
(file)
--- a/
src/be/nikiroo/fanfix/supported/FimfictionApi.java
+++ b/
src/be/nikiroo/fanfix/supported/FimfictionApi.java
@@
-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();