diff --git a/src/navigator/mod.rs b/src/navigator/mod.rs index ffeb443..70b434a 100644 --- a/src/navigator/mod.rs +++ b/src/navigator/mod.rs @@ -37,7 +37,9 @@ impl NavigationHandle { pub async fn push + 'static>(&self, input: I) -> Option { let navigator = self.unwrap_navigator(); let receiver = navigator.push::(input); - receiver.await.expect("The sender to send the result of a screen was dropped.") + + // If the sender is dropped, return None. + receiver.await.unwrap_or(None) } /// Go back to the previous screen optionally returning something. @@ -137,7 +139,8 @@ impl Navigator { self.clear_old_widgets(); } - receiver.await.expect("The sender to send the result of a screen was dropped.") + // We ignore the case, if a sender is dropped. + receiver.await.unwrap_or(None) }