diff --git a/lib/OrdinaryDiffEqDifferentiation/src/linsolve_utils.jl b/lib/OrdinaryDiffEqDifferentiation/src/linsolve_utils.jl index 2783468376..d18f570ca0 100644 --- a/lib/OrdinaryDiffEqDifferentiation/src/linsolve_utils.jl +++ b/lib/OrdinaryDiffEqDifferentiation/src/linsolve_utils.jl @@ -10,10 +10,11 @@ function dolinsolve(integrator, linsolve; A = nothing, linu = nothing, b = nothi _alg = unwrap_alg(integrator, true) if !isnothing(A) - (;du, u, p, t) = integrator if isnothing(integrator) reinit!(linsolve; A) else + (;u, p, t) = integrator + du = hasproperty(integrator) ? integrator.du : nothing p = (du, u, p, t) reinit!(linsolve; A, p) end