Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/solutions/ode_solutions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,7 @@ function Base.showerror(io::IO, e::LazyInterpolationException)
end

function strip_solution(sol::ODESolution; strip_alg = false)
if has_lazy_interpolation(sol.alg)
if sol.alg !== nothing && has_lazy_interpolation(sol.alg)
throw(LazyInterpolationException(nameof(typeof(sol.alg))))
end

Expand Down
9 changes: 9 additions & 0 deletions test/downstream/ode_stripping.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,12 @@ stripped_sol = SciMLBase.strip_solution(sol)
@test isnothing(stripped_sol.interp.cache.jac_config)

@test isnothing(stripped_sol.interp.cache.grad_config)

@testset "`nothing` alg with empty ODE" begin
prob = ODEProblem(Returns(nothing), nothing, (0.0, 1.0), nothing)
sol = solve(prob, Tsit5())
@test sol.alg === nothing
stripped_sol = SciMLBase.strip_solution(sol)
@test stripped_sol.alg === nothing
@test stripped_sol.prob == (; p = nothing)
end
Loading