diff --git a/lib/src/screens/send/send_page.dart b/lib/src/screens/send/send_page.dart index 6f4cd0bde..33e199487 100644 --- a/lib/src/screens/send/send_page.dart +++ b/lib/src/screens/send/send_page.dart @@ -365,17 +365,15 @@ class SendPage extends BasePage { reaction((_) => sendViewModel.state, (ExecutionState state) { if (state is FailureState) { WidgetsBinding.instance.addPostFrameCallback((_) { - if (context.mounted) { - showPopUp( - context: context, - builder: (BuildContext context) { - return AlertWithOneAction( - alertTitle: S.of(context).error, - alertContent: state.error, - buttonText: S.of(context).ok, - buttonAction: () => Navigator.of(context).pop()); - }); - } + showPopUp( + context: context, + builder: (BuildContext context) { + return AlertWithOneAction( + alertTitle: S.of(context).error, + alertContent: state.error, + buttonText: S.of(context).ok, + buttonAction: () => Navigator.of(context).pop()); + }); }); } diff --git a/lib/utils/exception_handler.dart b/lib/utils/exception_handler.dart index 0886cd8de..5a481cf42 100644 --- a/lib/utils/exception_handler.dart +++ b/lib/utils/exception_handler.dart @@ -120,6 +120,7 @@ class ExceptionHandler { static bool _ignoreError(String error) { return error.contains("errno = 103") || // SocketException: Software caused connection abort error.contains("errno = 9") || // SocketException: Bad file descriptor + error.contains("errno = 32") || // SocketException: Write failed (OS Error: Broken pipe) error.contains("errno = 54"); // SocketException: Connection reset by peer } } diff --git a/lib/utils/show_pop_up.dart b/lib/utils/show_pop_up.dart index 190b2a6d7..66748f6c2 100644 --- a/lib/utils/show_pop_up.dart +++ b/lib/utils/show_pop_up.dart @@ -8,13 +8,16 @@ Future showPopUp({ bool useSafeArea = false, bool useRootNavigator = true, RouteSettings? routeSettings -}) { - return showDialog( - context: context, - builder: builder, - barrierDismissible: barrierDismissible, - barrierColor: barrierColor, - useSafeArea: useSafeArea, - useRootNavigator: useRootNavigator, - routeSettings: routeSettings); +}) async { + if (context.mounted) { + return showDialog( + context: context, + builder: builder, + barrierDismissible: barrierDismissible, + barrierColor: barrierColor, + useSafeArea: useSafeArea, + useRootNavigator: useRootNavigator, + routeSettings: routeSettings); + } + return null; }