Skip to content

Commit 7a886b8

Browse files
committed
avoid recursion issue when theme is missing
1 parent e169794 commit 7a886b8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

R/guides-.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ Guides <- ggproto(
274274
#
275275
# The resulting guide is then drawn in ggplot_gtable
276276

277-
build = function(self, scales, layers, labels, layer_data, theme = theme()) {
277+
build = function(self, scales, layers, labels, layer_data, theme = NULL) {
278278

279279
# Empty guides list
280280
custom <- self$get_custom()
@@ -300,6 +300,7 @@ Guides <- ggproto(
300300
}
301301

302302
# Merge and process layers
303+
theme <- theme %||% theme()
303304
guides$merge()
304305
guides$process_layers(layers, layer_data, theme)
305306
if (length(guides$guides) == 0) {

0 commit comments

Comments
 (0)