Skip to content

Commit

Permalink
Explicitly include NULL as a value that tagQueryFindDescendants_() sh…
Browse files Browse the repository at this point in the history
…ouldn't traverse (#408)
  • Loading branch information
cpsievert committed Oct 5, 2023
1 parent 3fab22f commit 3696315
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: htmltools
Type: Package
Title: Tools for HTML
Version: 0.5.6
Version: 0.5.7
Authors@R: c(
person("Joe", "Cheng", role = "aut", email = "[email protected]"),
person("Carson", "Sievert", role = c("aut", "cre"), email = "[email protected]", comment = c(ORCID = "0000-0002-4958-2844")),
Expand Down
6 changes: 6 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# htmltools 0.5.7

## Improvements

* `tagQuery()` no longer throws an error when attempting to traverse a NULL value with r-devel. (#407)

# htmltools 0.5.6

## Possibly breaking changes
Expand Down
2 changes: 1 addition & 1 deletion R/tag_query.R
Original file line number Diff line number Diff line change
Expand Up @@ -1532,7 +1532,7 @@ tagQueryFindDescendants_ <- function(el, selector, fn) {
} else if (is.list(el)) {
# For each item in the list like object, recurse through
walk(el, tagQueryFindDescendants_, fn = fn, selector = selector)
} else if (is.atomic(el) || is.function(el) || is.language(el)) {
} else if (is.null(el) || is.atomic(el) || is.function(el) || is.language(el)) {
# Can not match on atomics or functions
return()
} else {
Expand Down

0 comments on commit 3696315

Please sign in to comment.