diff --git a/src/solve.jl b/src/solve.jl index 816b9ab6b..de102cc3b 100644 --- a/src/solve.jl +++ b/src/solve.jl @@ -710,6 +710,8 @@ function step!(integ::NullODEIntegrator, dt = nothing, stop_at_tdt = false) end return nothing end +function SciMLBase.u_modified!(integ::NullODEIntegrator, u) end +SciMLBase.check_error(integ::NullODEIntegrator) = integ.sol.retcode function hack_null_solution_init(prob) if SciMLBase.has_initialization_data(prob.f) diff --git a/test/downstream/null_de.jl b/test/downstream/null_de.jl index 7405091a6..2ebd505c3 100644 --- a/test/downstream/null_de.jl +++ b/test/downstream/null_de.jl @@ -88,3 +88,10 @@ end sol = solve(prob) @test sol.resid isa SVector{1, Float64} end + +@testset "`u_modified!` works on null integrators" begin + prob = ODEProblem(Returns(nothing), nothing, (0.0, 1.0)) + integ = init(prob, Tsit5()) + @test_nowarn SciMLBase.u_modified!(integ, Float64[]) + @test SciMLBase.successful_retcode(SciMLBase.check_error(integ)) +end