Skip to content

Commit 0d37a05

Browse files
fix: fix usage of undefined variable in get_initial_values
1 parent 80e6ea5 commit 0d37a05

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/initialization.jl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,8 +287,11 @@ function get_initial_values(prob, valp, f, alg::OverrideInit,
287287
# Do not accept StalledSuccess as a solution
288288
# A good local minima is not a success
289289
resid = nlsol.resid
290-
normresid = isdefined(integrator.opts, :internalnorm) ?
291-
integrator.opts.internalnorm(resid, t) : norm(resid)
290+
normresid = if valp isa DEIntegrator && isdefined(valp.opts, :internalnorm)
291+
valp.opts.internalnorm(resid, current_time(valp))
292+
else
293+
norm(resid)
294+
end
292295
SciMLBase.successful_retcode(nlsol) && normresid <= abstol
293296
else
294297
SciMLBase.successful_retcode(nlsol)

0 commit comments

Comments
 (0)