diff --git a/src/main/java/io/prismic/core/HttpClient.java b/src/main/java/io/prismic/core/HttpClient.java index 950afac..6a5efd0 100644 --- a/src/main/java/io/prismic/core/HttpClient.java +++ b/src/main/java/io/prismic/core/HttpClient.java @@ -60,7 +60,7 @@ public static JsonNode fetch(String url, Logger logger, Cache cache, Proxy proxy InputStream errorStream = httpConnection.getErrorStream(); if(errorStream != null) { JsonNode errorJson = new ObjectMapper().readTree(errorStream); - if (errorJson != null) { + if (errorJson != null && errorJson.get("error") != null) { errorText = errorJson.get("error").asText(); } }