Skip to content

Commit 1436853

Browse files
committed
attempt to tone down spurious warnings
1 parent 7547832 commit 1436853

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

R/plot-construction.R

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,10 @@ S7::method(update_ggplot, list(S7::class_any, class_ggplot)) <-
135135
function(object, plot, object_name, ...) {
136136

137137
if (!S7::S7_inherits(object) && inherits(object, "theme")) {
138+
# This is a contingency for patchwork/#438
139+
if (length(object) == 0) {
140+
return(plot)
141+
}
138142
# For backward compatibility, we try to cast old S3 themes (lists with
139143
# the class 'theme') to proper themes. People *should* use `theme()`,
140144
# so we should be pushy here.

0 commit comments

Comments
 (0)