@@ -142,13 +142,12 @@ end
142142
143143 resids = map (x -> Symbol (" $(x) _resid" ), cache_syms)
144144 for (sym, resid) in zip (cache_syms, resids)
145- push! (calls, :($ (resid) = get_fu ($ (sym))))
145+ push! (calls, :($ (resid) = @isdefined ( $ (sym)) ? get_fu ($ (sym)) : nothing ))
146146 end
147147 push! (calls,
148148 quote
149149 fus = tuple ($ (Tuple (resids)... ))
150150 minfu, idx = __findmin (cache. internalnorm, fus)
151- idx += cache. alg. start_index - 1
152151 stats = __compile_stats (cache. caches[idx])
153152 u = get_u (cache. caches[idx])
154153 retcode = cache. caches[idx]. retcode
@@ -225,13 +224,12 @@ for (probType, pType) in ((:NonlinearProblem, :NLS), (:NonlinearLeastSquaresProb
225224
226225 resids = map (x -> Symbol (" $(x) _resid" ), sol_syms)
227226 for (sym, resid) in zip (sol_syms, resids)
228- push! (calls, :($ (resid) = $ (sym). resid))
227+ push! (calls, :($ (resid) = @isdefined ( $ (sym)) ? $ (sym) . resid : nothing ))
229228 end
230229
231230 push! (calls, quote
232231 resids = tuple ($ (Tuple (resids)... ))
233232 minfu, idx = __findmin (DEFAULT_NORM, resids)
234- idx += alg. start_index - 1
235233 end )
236234
237235 for i in 1 : N
0 commit comments