Restore context changes
This commit is contained in:
1 parent
9496853fbc
commit
28d71624ef
1 file changed
+1
-10
@@ -125,16 +125,7 @@ impl Runtime {
|
|||||||
/// This is useful for inserting or removing contexts from a scope, or rendering out its root node
|
/// This is useful for inserting or removing contexts from a scope, or rendering out its root node
|
||||||
pub(crate) fn get_context(&self, id: ScopeId) -> Option<Ref<'_, ScopeContext>> {
|
pub(crate) fn get_context(&self, id: ScopeId) -> Option<Ref<'_, ScopeContext>> {
|
||||||
Ref::filter_map(self.scope_contexts.borrow(), |contexts| {
|
Ref::filter_map(self.scope_contexts.borrow(), |contexts| {
|
||||||
match contexts.get(id.0) {
|
contexts.get(id.0).and_then(|f| f.as_ref())
|
||||||
Some(context) => context.as_ref(),
|
|
||||||
_ => {
|
|
||||||
tracing::error!(
|
|
||||||
"Attempted to get context for scope that doesn't exist (id: {})",
|
|
||||||
id.0
|
|
||||||
);
|
|
||||||
None
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
.ok()
|
.ok()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user