only call without_reactive_context when the controller exists

pull/16570/head
Rich Harris 1 month ago
parent 3ca469a52e
commit 92f705295f

@ -407,9 +407,13 @@ export function destroy_effect_children(signal, remove_dom = false) {
signal.first = signal.last = null;
while (effect !== null) {
const controller = effect.ac;
if (controller !== null) {
without_reactive_context(() => {
/** @type {Effect} */ (effect).ac?.abort(STALE_REACTION);
controller.abort(STALE_REACTION);
});
}
var next = effect.next;

@ -282,6 +282,7 @@ export function update_reaction(reaction) {
without_reactive_context(() => {
/** @type {AbortController} */ (reaction.ac).abort(STALE_REACTION);
});
reaction.ac = null;
}

Loading…
Cancel
Save