Skip to content

Commit c6bb1f3

Browse files
committed
only check for rvars format if format not NULL
1 parent d04a6d5 commit c6bb1f3

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

R/utils.R

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -356,18 +356,19 @@ as_draws_format_fun <- function(draws_format) {
356356
}
357357

358358
assert_valid_draws_format <- function(format) {
359-
if (!is.null(format) &&
360-
!format %in% valid_draws_formats()) {
361-
stop(
362-
"The supplied draws format is not valid. ",
363-
call. = FALSE
364-
)
365-
}
366-
if (format %in% c("rvars", "draws_rvars")) {
367-
stop(
368-
"\nWe are fixing a bug in fit$draws(format = 'draws_rvars').",
369-
"\nFor now please use posterior::as_draws_rvars(fit$draws()) instead."
370-
)
359+
if (!is.null(format)) {
360+
if (!format %in% valid_draws_formats()) {
361+
stop(
362+
"The supplied draws format is not valid. ",
363+
call. = FALSE
364+
)
365+
}
366+
if (format %in% c("rvars", "draws_rvars")) {
367+
stop(
368+
"\nWe are fixing a bug in fit$draws(format = 'draws_rvars').",
369+
"\nFor now please use posterior::as_draws_rvars(fit$draws()) instead."
370+
)
371+
}
371372
}
372373
invisible(format)
373374
}

0 commit comments

Comments
 (0)