diff --git a/NEWS.md b/NEWS.md index 29b8a2ebf..f3ae3dc6f 100644 --- a/NEWS.md +++ b/NEWS.md @@ -18,6 +18,7 @@ - A bug was fixed where the initial growth was never estimated (i.e. the prior mean was always zero). By @sbfnk in #853 and reviewed by @seabbs. - A bug was fixed where an internal function for applying a default cdf cutoff failed due to a difference a vector length issue. By @jamesmbaazam in #858 and reviewed by @sbfnk. - All parameters have been changed to the new parameter interface. By @sbfnk in #871 and reviewed by @seabbs. +- A bug was fixed where `plot.dist_spec()` wasn't throwing an informative error due to an incomplete check for the max of the specified delay. By @jamesmbaazam in #858 and reviewed by @. ## Package changes diff --git a/R/dist_spec.R b/R/dist_spec.R index 37d368362..5b9a155ba 100644 --- a/R/dist_spec.R +++ b/R/dist_spec.R @@ -718,7 +718,7 @@ plot.dist_spec <- function(x, samples = 50L, res = 1, cumulative = TRUE, ...) { cdf_cutoff <- 0 } pmf_dt <- lapply(dists, function(y) { - if (is.infinite(attr(y, "max"))) { + if (is.infinite(max(y))) { cli_abort( c( "!" = "All distributions in {.var x} must have a finite