From 46b159d21e667ad5e61f3a1178aedd9b7a964546 Mon Sep 17 00:00:00 2001 From: Teun van den Brand Date: Tue, 10 Sep 2024 15:31:38 +0200 Subject: [PATCH] fallback when constructor call is missing --- R/plot-construction.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/plot-construction.R b/R/plot-construction.R index 14f2badaed..e6a86139eb 100644 --- a/R/plot-construction.R +++ b/R/plot-construction.R @@ -196,7 +196,7 @@ new_layer_names <- function(layer, existing) { new_name <- layer$name if (is.null(new_name)) { # Construct a name from the layer's call - new_name <- call_name(layer$constructor) + new_name <- call_name(layer$constructor) %||% snake_class(layer$geom) if (new_name %in% existing) { names <- c(existing, new_name)