Skip to content

Commit

Permalink
Fix IllegalArgumentException in IEEE
Browse files Browse the repository at this point in the history
  • Loading branch information
koppor committed Sep 29, 2024
1 parent d1c33d9 commit f406414
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/java/org/jabref/logic/importer/fetcher/IEEE.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import org.jabref.model.entry.field.StandardField;
import org.jabref.model.entry.identifier.DOI;
import org.jabref.model.entry.types.StandardEntryType;
import org.jabref.model.strings.StringUtil;

import kong.unirest.core.json.JSONArray;
import kong.unirest.core.json.JSONObject;
Expand Down Expand Up @@ -118,10 +119,9 @@ private static BibEntry parseJsonResponse(JSONObject jsonEntry, Character keywor
entry.setField(StandardField.ISBN, jsonEntry.optString("isbn"));
entry.setField(StandardField.ISSN, jsonEntry.optString("issn"));
entry.setField(StandardField.ISSUE, jsonEntry.optString("issue"));
try {
entry.addFile(new LinkedFile(URI.create(jsonEntry.optString("pdf_url")).toURL(), "PDF"));
} catch (MalformedURLException e) {
LOGGER.error("Fetched PDF URL String is malformed.");
String pdfUrl = jsonEntry.optString("pdf_url");
if (!StringUtil.isBlank(pdfUrl)) {
entry.addFile(new LinkedFile("", pdfUrl, "PDF"));
}
entry.setField(StandardField.JOURNALTITLE, jsonEntry.optString("publication_title"));
entry.setField(StandardField.DATE, jsonEntry.optString("publication_date"));
Expand Down

0 comments on commit f406414

Please sign in to comment.