Skip to content

Commit d930620

Browse files
committed
use isdefined
1 parent 88d79e7 commit d930620

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/callbacks.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -765,7 +765,7 @@ end
765765

766766
function apply_callback!(integrator,callback::Union{ContinuousCallback,VectorContinuousCallback},cb_time,prev_sign,event_idx)
767767

768-
if is_integrator_adaptive(integrator)
768+
if isadaptive(integrator)
769769
set_proposed_dt!(integrator, max(nextfloat(integrator.opts.dtmin), callback.dtrelax * integrator.dt))
770770
end
771771

src/integrator_interface.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -580,4 +580,5 @@ has_destats(i::DEIntegrator) = false
580580
581581
Checks if the integrator is adaptive
582582
"""
583-
is_integrator_adaptive(integrator::DEIntegrator) = integrator.opts.adaptive
583+
isadaptive(integrator::DEIntegrator) =
584+
isdefined(integrator.opts, :adaptive) ? integrator.opts.adaptive : false

0 commit comments

Comments
 (0)