Skip to content

Commit 4af29c0

Browse files
committed
fix(brand_pluck): If not subsettable, return FALSE
1 parent 9790265 commit 4af29c0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

R/bs-theme-preset-brand.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -785,7 +785,8 @@ brand_has <- function(brand, ...) {
785785
x <- brand
786786

787787
for (f in c(...)) {
788-
if (is.null(x[[f]])) return(FALSE)
788+
val <- tryCatch(x[[f]], error = function(e) NULL)
789+
if (is.null(val)) return(FALSE)
789790
x <- x[[f]]
790791
}
791792

0 commit comments

Comments
 (0)