Skip to content

Commit

Permalink
Fix NAs in bibliography_entries()
Browse files Browse the repository at this point in the history
Resolves #147
  • Loading branch information
mitchelloharawild committed Jan 10, 2021
1 parent c7a73d1 commit cf76529
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# vitae (development version)

## Bug fixes

* Fixed "na.character" entries resulting in `bibliography_entries()` that differ
in the fields used (#147).

# vitae 0.3.0

This release makes substantial changes to how bibliographies included in a
Expand Down
2 changes: 1 addition & 1 deletion R/bibliography.R
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ knit_print.vitae_bibliography <- function(x, options = knitr::opts_current$get()
x <- as.list(x)
el_is_list <- vapply(x, is.list, logical(1L))
x[el_is_list] <- lapply(x[el_is_list], `[[`, i=1)
Filter(function(x) length(x) > 0, x)
Filter(function(x) !is.na(x) && length(x) > 0, x)
})
if((options$cache %||% 0) == 0) {
file <- tempfile(fileext = ".yaml")
Expand Down

0 comments on commit cf76529

Please sign in to comment.