Skip to content

Commit d41a675

Browse files
author
Wim
committed
Do not create structure with NULL to remove warnings
1 parent 4c0c7d8 commit d41a675

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

R/plotly_build.R

+6-4
Original file line numberDiff line numberDiff line change
@@ -280,10 +280,12 @@ plotly_build.plotly <- function(p, registerFrames = TRUE) {
280280
)
281281
for (i in x$.plotlyVariableMapping) {
282282
# try to reduce the amount of data we have to send for non-positional scales
283-
x[[i]] <- structure(
284-
if (i %in% npscales()) uniq(d[[i]]) else d[[i]],
285-
class = oldClass(x[[i]])
286-
)
283+
entry <- if (i %in% npscales()) uniq(d[[i]]) else d[[i]]
284+
if (is.null(entry)) {
285+
x[[i]] <- NULL
286+
} else {
287+
x[[i]] <- structure(entry, class = oldClass(x[[i]]))
288+
}
287289
}
288290
x
289291
})

0 commit comments

Comments
 (0)