Skip to content

Commit 0941f05

Browse files
committed
more transparent logic
1 parent 8776482 commit 0941f05

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

R/utils.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,7 @@ colorscale_json <- function(x) {
675675
if (is.list(x) && length(x) == 2) {
676676
n1 <- length(x[[1]])
677677
n2 <- length(x[[2]])
678-
if (n1 != n2 || n1+n2 == 0) {
678+
if (n1 != n2 || n1 == 0 || n2 == 0) {
679679
warning("A colorscale list must of elements of the same (non-zero) length")
680680
} else if (!is.data.frame(x) && can_be_numeric(x[[1]])) {
681681
x <- data.frame(

0 commit comments

Comments
 (0)