diff --git a/leptos_reactive/src/runtime.rs b/leptos_reactive/src/runtime.rs index 002a4e7ad8..7c1c0de369 100644 --- a/leptos_reactive/src/runtime.rs +++ b/leptos_reactive/src/runtime.rs @@ -864,8 +864,9 @@ pub fn try_with_owner(owner: Owner, f: impl FnOnce() -> T) -> Option { runtime .nodes .try_borrow() - .map(|nodes| { - if nodes.contains_key(owner.0) { + .map(|nodes| nodes.contains_key(owner.0)) + .map(|scope_exists| { + if scope_exists { let prev_observer = runtime.observer.take(); let prev_owner = runtime.owner.take();