Skip to content

Commit

Permalink
fix double panic
Browse files Browse the repository at this point in the history
  • Loading branch information
Noah-Kennedy committed Oct 26, 2022
1 parent ce36b81 commit 78b5f73
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/runtime/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ impl RuntimeContext {

/// Check if driver is initialized
pub(crate) fn is_set(&self) -> bool {
self.driver.borrow().is_some()
self.driver
.try_borrow()
.map(|b| b.is_some())
.unwrap_or(false)
}

/// Execute a function which requires access to the driver.
Expand Down

0 comments on commit 78b5f73

Please sign in to comment.