From 397fb14be7e1ebbc0e93b311cc419caa06de2b37 Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Sat, 9 Apr 2016 22:08:34 +0000 Subject: [PATCH] Throw exception if result is null (shouldn't happen unless cache/etag is out of sync) --- source/net/filebot/CachedResource.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/net/filebot/CachedResource.java b/source/net/filebot/CachedResource.java index 1777eac1..dba1c63b 100644 --- a/source/net/filebot/CachedResource.java +++ b/source/net/filebot/CachedResource.java @@ -85,6 +85,10 @@ public class CachedResource implements Resource { return element.getObjectValue(); } + if (data == null) { + throw new IllegalStateException(String.format("Response data is null: %s => %s", key, url)); + } + return parse.transform(data); } catch (IOException e) { debug.warning(format("Fetch failed: %s", e.getMessage()));