Skip to content

Commit

Permalink
Titles are optional at crossref (#3378)
Browse files Browse the repository at this point in the history
  • Loading branch information
lenhard authored and Siedlerchr committed Oct 31, 2017
1 parent 42ea6bc commit 1ebdea4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(""));
Expand Down

0 comments on commit 1ebdea4

Please sign in to comment.