Skip to content

Commit fc3dd21

Browse files
committed
check if init_params is nothing before collect
1 parent c985383 commit fc3dd21

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/sample.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ function mcmcsample(
315315
# Ensure that initial parameters are `nothing` or of the correct length
316316
check_initial_params(init_params, nchains)
317317
# We will use `getindex` later so we need to `collect`.
318-
_init_params = collect(init_params)
318+
_init_params = init_params !== nothing ? collect(init_params) : nothing
319319

320320
# Set up a chains vector.
321321
chains = Vector{Any}(undef, nchains)

0 commit comments

Comments
 (0)