Skip to content

Commit d5387ec

Browse files
committed
fix incorrect conditional
1 parent 2239fc8 commit d5387ec

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/OrdinaryDiffEqCore/src/initdt.jl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,11 @@
127127
# Better than checking any(x->any(isnan, x), f₀)
128128
# because it also checks if partials are NaN
129129
# https://discourse.julialang.org/t/incorporating-forcing-functions-in-the-ode-model/70133/26
130-
if integrator.opts.verbose && isnan(d₁)
131-
@warn("First function call produced NaNs. Exiting. Double check that none of the initial conditions, parameters, or timespan values are NaN.")
130+
if isnan(d₁)
131+
if integrator.opts.verbose
132+
@warn("First function call produced NaNs. Exiting. Double check that none of the initial conditions, parameters, or timespan values are NaN.")
133+
end
134+
132135
return tdir * dtmin
133136
end
134137

0 commit comments

Comments
 (0)