Throw exception if result is null (shouldn't happen unless cache/etag is out of sync)

This commit is contained in:
Reinhard Pointner 2016-04-09 22:08:34 +00:00
parent 2fac737052
commit 397fb14be7
1 changed files with 4 additions and 0 deletions

View File

@ -85,6 +85,10 @@ public class CachedResource<K, R> implements Resource<R> {
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()));