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 3, 2023
1 parent 3fab22f commit a5fb3e7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
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 a5fb3e7

Please sign in to comment.