Skip to content

Commit 29c1ac4

Browse files
committed
Allow NULL to be added to theme objects
1 parent 7022d31 commit 29c1ac4

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

R/theme.r

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,9 @@ plot_theme <- function(x, default = theme_get()) {
454454
#' informative error messages.
455455
#' @keywords internal
456456
add_theme <- function(t1, t2, t2name) {
457+
if (is.null(t2)) {
458+
return(t1)
459+
}
457460
if (!is.list(t2)) { # in various places in the code base, simple lists are used as themes
458461
abort(glue("Can't add `{t2name}` to a theme object."))
459462
}

0 commit comments

Comments
 (0)