diff --git a/orcid-core/src/main/java/org/orcid/core/utils/v3/identifiers/resolvers/PubMedResolver.java b/orcid-core/src/main/java/org/orcid/core/utils/v3/identifiers/resolvers/PubMedResolver.java index 7a8620686bf..b7dfdbb567a 100644 --- a/orcid-core/src/main/java/org/orcid/core/utils/v3/identifiers/resolvers/PubMedResolver.java +++ b/orcid-core/src/main/java/org/orcid/core/utils/v3/identifiers/resolvers/PubMedResolver.java @@ -217,13 +217,15 @@ private WorkExtended getWork(JSONObject json) throws JSONException, ParseExcepti // If we find the html link, use it and stop // searching - if (urlType.equals("html")) { - if(availability == null || availability.equals("Free") || availability.equals("Open access")) { + if (urlType != null) { + if (urlType.equals("html")) { + if(availability == null || availability.equals("Free") || availability.equals("Open access")) { + work.setUrl(new Url(url.getString("url"))); + break; + } + } else if (urlType.equals("doi")) { work.setUrl(new Url(url.getString("url"))); - break; } - } else if (urlType.equals("doi")) { - work.setUrl(new Url(url.getString("url"))); } } }