diff --git a/packages/behavior/src/traits/behaved.js b/packages/behavior/src/traits/behaved.js index ab5fb69..2a145a2 100644 --- a/packages/behavior/src/traits/behaved.js +++ b/packages/behavior/src/traits/behaved.js @@ -184,7 +184,9 @@ export default (latus) => class Behaved extends decorate(Trait) { updateCurrentRoutine(currentRoutine) { this.#currentRoutine = this.#routines[currentRoutine]; - this.#currentRoutine.reset(); + if (this.#currentRoutine) { + this.#currentRoutine.reset(); + } super.currentRoutine = currentRoutine; }