diff --git a/NEWS.md b/NEWS.md index 4db61489c..1f625ad74 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,6 +2,8 @@ * `navset_card_pills()`, `navset_card_underline()`, `navset_card_tabs()` fixed to now respect header/footer arguments (@tanho63, #1024) +* `bs_themer()` fixed to prevent NULL values from crashing themer, fix #1111. (@meztez, #1112). + # bslib 0.8.0 ## Breaking changes diff --git a/R/bs-theme-preview.R b/R/bs-theme-preview.R index 86d34a9a0..20c49f3b3 100644 --- a/R/bs-theme-preview.R +++ b/R/bs-theme-preview.R @@ -411,7 +411,7 @@ bs_themer <- function(gfonts = TRUE, gfonts_update = FALSE) { # Validate that `vals` is a simple list, containing atomic elements, # that are all named if (!identical(class(vals), "list") || - !all(vapply(vals, is.atomic, logical(1))) || + !all(vapply(vals, function(x) {is.atomic(x) || is.null(x)}, logical(1))) || is.null(names(vals)) || !isTRUE(all(nzchar(names(vals), keepNA = TRUE)))) { warning(call. = FALSE,