Skip to content

Commit faddb48

Browse files
committed
Fix testing if object not null
It should be checked if an Entity has a contentType, not if an Entity has content. See #292 (comment) and #292 (comment).
1 parent 1229f73 commit faddb48

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/src/main/java/com/github/jsonldjava/utils/JsonUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ private static Object fromJsonLdViaHttpUri(final URL url, final CloseableHttpCli
383383

384384
private static URL alternateLink(URL url, CloseableHttpResponse response)
385385
throws MalformedURLException, IOException {
386-
if (response.getEntity().getContentLength() > 0
386+
if (response.getEntity().getContentType() != null
387387
&& !response.getEntity().getContentType().getValue().equals("application/ld+json")) {
388388
for (Header header : response.getAllHeaders()) {
389389
if (header.getName().equalsIgnoreCase("link")) {

0 commit comments

Comments
 (0)