From a5fb3e79de6a7f3be0088d45fa95445fa5f1024c Mon Sep 17 00:00:00 2001 From: Carson Sievert Date: Tue, 3 Oct 2023 10:51:04 -0500 Subject: [PATCH] Explicitly include NULL as a value that tagQueryFindDescendants_() shouldn't traverse (#408) --- NEWS.md | 6 ++++++ R/tag_query.R | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index f9bcc2b7..27c6a0be 100644 --- a/NEWS.md +++ b/NEWS.md @@ -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 diff --git a/R/tag_query.R b/R/tag_query.R index d310edb3..669c8d0a 100644 --- a/R/tag_query.R +++ b/R/tag_query.R @@ -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 {