fix: guard against null

This commit is contained in:
cha0s 2021-04-20 03:00:17 -05:00
parent 59b902753e
commit 82cf2934ad

View File

@ -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;
}