Skip to content

Commit

Permalink
Fix JSONException in Crossref fetcher as mentioned in #2442
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiasdiez committed Mar 19, 2017
1 parent 63620ff commit 51653c1
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,12 @@ private String toAuthors(JSONArray authors) {
AuthorList authorsParsed = new AuthorList();
for (int i = 0; i < authors.length(); i++) {
JSONObject author = authors.getJSONObject(i);
authorsParsed.addAuthor(author.getString("given"), "", "", author.getString("family"), "");
authorsParsed.addAuthor(
author.optString("given", ""),
"",
"",
author.optString("family", ""),
"");
}
return authorsParsed.getAsFirstLastNamesWithAnd();
}
Expand Down

0 comments on commit 51653c1

Please sign in to comment.