Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix regression from #5967 #6095

Merged
merged 1 commit into from
Sep 16, 2024
Merged

Conversation

teunbrand
Copy link
Collaborator

This PR fixes a regression from #5967 that is detectable as:

ggplot2/revdep/problems.md

Lines 155 to 156 in d31c051

Error in if (new_name %in% existing) { : argument is of length zero
Calls: plot_history ... add_ggplot -> ggplot_add -> ggplot_add.Layer -> new_layer_names

Briefly, this error occurs when the constructor call doesn't get captured cleanly, like in the following case:

library(ggplot2)
rlang::call_name(do.call(geom_point, list())$constructor)
#> NULL

Created on 2024-09-10 with reprex v2.1.1

In this PR, we construct a fallback name based on the geom's ggproto class.

@teunbrand
Copy link
Collaborator Author

Thanks for the review!

@teunbrand teunbrand merged commit d742881 into tidyverse:main Sep 16, 2024
13 checks passed
@teunbrand teunbrand deleted the empty_layer_names branch September 16, 2024 08:34
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants