diff --git a/src/main/java/org/jabref/logic/importer/util/ShortDOIService.java b/src/main/java/org/jabref/logic/importer/util/ShortDOIService.java index 4c39290c0de..f18ed4e5ac0 100644 --- a/src/main/java/org/jabref/logic/importer/util/ShortDOIService.java +++ b/src/main/java/org/jabref/logic/importer/util/ShortDOIService.java @@ -53,7 +53,11 @@ private JSONObject makeRequest(DOI doi) throws ShortDOIServiceException { URLDownload urlDownload = new URLDownload(url); try { - return JsonReader.toJsonObject(urlDownload.asInputStream()); + JSONObject resultAsJSON = JsonReader.toJsonObject(urlDownload.asInputStream()); + if (resultAsJSON.isEmpty()) { + throw new ShortDOIServiceException("Cannot get short DOI"); + } + return resultAsJSON; } catch (ParseException | IOException | JSONException e) { throw new ShortDOIServiceException("Cannot get short DOI", e); }