Skip to content

Commit

Permalink
Fix exception when no citekey is present (#2904)
Browse files Browse the repository at this point in the history
  • Loading branch information
Siedlerchr authored and LinusDietz committed Jun 11, 2017
1 parent 42c2ca4 commit c711a7f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `#
- We fixed a bug that only allowed parsing positive timezones from a FileAnnotation [#2839](https://github.com/JabRef/jabref/issues/2839)
- We fixed a bug that did not allow the correct re-export of the MS-Office XML field `msbib-accessed` with a different date format [#2859](https://github.com/JabRef/jabref/issues/2859).
- We fixed some bugs that prevented the display of FileAnnotations that were created using the Foxit Reader. [#2839, comment](https://github.com/JabRef/jabref/issues/2839#issuecomment-302058227).
- We fixed an error that prevented the FileAnnotation tab to load when the entry had no bibtexkey [#2903](https://github.com/JabRef/jabref/issues/2903).
### Removed


Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/jabref/logic/pdf/FileAnnotationCache.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ public Map<String, List<FileAnnotation>> load(BibEntry entry) throws Exception {
* @return Map containing a list of annotations in a list for each file
*/
public Map<String, List<FileAnnotation>> getFromCache(BibEntry entry) {
LOGGER.debug(String.format("Loading Bibentry '%s' from cache.", entry.getField(BibEntry.KEY_FIELD).get()));
LOGGER.debug(String.format("Loading Bibentry '%s' from cache.", entry.getCiteKeyOptional().orElse(entry.getId())));
return annotationCache.getUnchecked(entry);
}

public void remove(BibEntry entry) {
LOGGER.debug(String.format("Deleted Bibentry '%s' from cache.", entry.getField(BibEntry.KEY_FIELD).get()));
LOGGER.debug(String.format("Deleted Bibentry '%s' from cache.", entry.getCiteKeyOptional().orElse(entry.getId())));
annotationCache.invalidate(entry);
}
}

0 comments on commit c711a7f

Please sign in to comment.