Skip to content

Commit f3b6191

Browse files
fix: improve hack for null solution initialization
1 parent 9a654f3 commit f3b6191

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/solve.jl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -712,11 +712,13 @@ function step!(integ::NullODEIntegrator, dt = nothing, stop_at_tdt = false)
712712
end
713713

714714
function hack_null_solution_init(prob)
715-
if SciMLBase.has_initializeprob(prob.f) && SciMLBase.has_initializeprobpmap(prob.f)
716-
initializeprob = prob.f.initializeprob
715+
if SciMLBase.has_initialization_data(prob.f)
716+
initializeprob = prob.f.initialization_data.initializeprob
717717
nlsol = solve(initializeprob)
718718
success = SciMLBase.successful_retcode(nlsol)
719-
@set! prob.p = prob.f.initializeprobpmap(prob, nlsol)
719+
if prob.f.initialization_data.initializeprobpmap !== nothing
720+
@set! prob.p = prob.f.initializeprobpmap(prob, nlsol)
721+
end
720722
else
721723
success = true
722724
end

0 commit comments

Comments
 (0)