Skip to content

Commit 3d26a9f

Browse files
jClugstorChrisRackauckas
authored andcommitted
fix tracing
1 parent 8a5d35a commit 3d26a9f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/NonlinearSolveBase/src/tracing.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,9 @@ function update_trace!(
204204
entry = if trace.trace_level.trace_mode isa Val{:minimal}
205205
NonlinearSolveTraceEntry(trace.prob, iter, fu, δu .* α, missing, missing)
206206
else
207-
J = convert(AbstractArray, J)
207+
if !isnothing(J)
208+
J = convert(AbstractArray, J)
209+
end
208210
if trace.trace_level.trace_mode isa Val{:condition_number}
209211
NonlinearSolveTraceEntry(trace.prob, iter, fu, δu .* α, J, missing)
210212
else
@@ -220,7 +222,7 @@ end
220222
function update_trace!(cache, α = true; uses_jac_inverse = Val(false))
221223
trace = Utils.safe_getproperty(cache, Val(:trace))
222224
trace === missing && return nothing
223-
225+
224226
J = Utils.safe_getproperty(cache, Val(:J))
225227
du = SciMLBase.get_du(cache)
226228
if J === missing

0 commit comments

Comments
 (0)