diff --git a/CHANGELOG.md b/CHANGELOG.md index bf91c2e88ff..cefce0a17d3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,6 +37,7 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `# - We fixed an issue where JabRef would not show the translated content at some points, although there existed a translation - We fixed an issue where editing in the source tab would override content of other entries [#3352](https://github.com/JabRef/jabref/issues/3352#issue-268580818) - We fixed several issues with the automatic linking of files in the entry editor where files were not found or not correctly saved in the bibtex source [#3346](https://github.com/JabRef/jabref/issues/3346) + - We fixed an issue where fetching entries from crossref that had no titles caused an error [#3376](https://github.com/JabRef/jabref/issues/3376) ### Removed diff --git a/src/main/java/org/jabref/logic/importer/fetcher/CrossRef.java b/src/main/java/org/jabref/logic/importer/fetcher/CrossRef.java index 3bbc0705db2..384c6b9986e 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/CrossRef.java +++ b/src/main/java/org/jabref/logic/importer/fetcher/CrossRef.java @@ -110,7 +110,9 @@ private BibEntry jsonItemToBibEntry(JSONObject item) throws ParseException { try { BibEntry entry = new BibEntry(); entry.setType(convertType(item.getString("type"))); - entry.setField(FieldName.TITLE, item.getJSONArray("title").optString(0)); + entry.setField(FieldName.TITLE, + Optional.ofNullable(item.optJSONArray("title")) + .map(array -> array.optString(0)).orElse("")); entry.setField(FieldName.SUBTITLE, Optional.ofNullable(item.optJSONArray("subtitle")) .map(array -> array.optString(0)).orElse(""));