diff --git a/CHANGELOG.md b/CHANGELOG.md index deecc643b20..948e77fb49d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -352,6 +352,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve - We fixed an issue where the "Attach file" dialog, in the right-click menu for an entry, started on the working directory instead of the user's main directory. [#4995](https://github.com/JabRef/jabref/issues/4995) - We fixed an issue where the JabRef Icon in the macOS launchpad was not displayed correctly [#5003](https://github.com/JabRef/jabref/issues/5003) - We fixed an issue where the "Search for unlinked local files" would throw an exception when parsing the content of a PDF-file with missing "series" information [#5128](https://github.com/JabRef/jabref/issues/5128) +- We fixed an issue where the XMP Importer would incorrectly return an empty default entry when importing pdfs [#6577](https://github.com/JabRef/jabref/issues/6577) ### Removed diff --git a/src/main/java/org/jabref/logic/xmp/DublinCoreExtractor.java b/src/main/java/org/jabref/logic/xmp/DublinCoreExtractor.java index 9c54524bc0a..fdf91c478e6 100644 --- a/src/main/java/org/jabref/logic/xmp/DublinCoreExtractor.java +++ b/src/main/java/org/jabref/logic/xmp/DublinCoreExtractor.java @@ -61,7 +61,7 @@ private void extractEditor() { private void extractAuthor() { List creators = dcSchema.getCreators(); if ((creators != null) && !creators.isEmpty()) { - bibEntry.setField(StandardField.AUTHOR, String.join(" and ", creators)); + bibEntry.setField(StandardField.AUTHOR, String.join(" and ", creators)); } } @@ -242,10 +242,10 @@ public Optional extractBibtexEntry() { this.extractTitle(); this.extractType(); - if (bibEntry.getType() == null) { - bibEntry.setType(BibEntry.DEFAULT_TYPE); + // we pass a new BibEntry in the constructor which is never empty as it already consists of "@misc" + if (bibEntry.getFieldMap().isEmpty()) { + return Optional.empty(); } - return Optional.of(bibEntry); }