Skip to content

Commit a5203d3

Browse files
committed
Better error message for missing/null mode
1 parent 0abee45 commit a5203d3

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

R/arguments.R

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,9 @@ set_args <- function(object, ...) {
7676
#' @rdname set_args
7777
#' @export
7878
set_mode <- function(object, mode) {
79-
if (is.null(mode))
80-
return(object)
79+
if (rlang::is_missing(mode)) mode <- NULL
8180
mode <- mode[1]
82-
if (!(any(all_modes == mode))) {
81+
if (is.null(mode) | !(any(all_modes == mode))) {
8382
rlang::abort(
8483
glue::glue(
8584
"`mode` should be one of ",

0 commit comments

Comments
 (0)