Skip to content

Commit

Permalink
abort for empty data
Browse files Browse the repository at this point in the history
  • Loading branch information
Yunuuuu committed Jan 6, 2025
1 parent 8e89f1d commit ab65e21
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions R/layout-chain-.R
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,19 @@ chain_layout_add.QuadLayout <- function(object, layout, object_name) {
object_name(object)
))
}
} else {
if (NROW(data) == 0L || ncol(data) == 0L) {
cli_abort(c(
sprintf(
"Cannot use data from %s in %s",
object_name(layout), object_name(object)
),
i = sprintf(
"{.arg data} in %s return is an empty matrix",
object_name(layout)
)
))
}
}
# set the `nobs` for `quad_layout()`
if (is_horizontal(direction)) {
Expand Down

0 comments on commit ab65e21

Please sign in to comment.