Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

fix: null check operator used on a null value

ashilknbde6483144fa
diff --git a/lib/ui/components/buttons/button_widget.dart b/lib/ui/components/buttons/button_widget.dart
index 7d26f20c15..01c1b84efe 100644
--- a/lib/ui/components/buttons/button_widget.dart
+++ b/lib/ui/components/buttons/button_widget.dart
@@ -492,12 +492,14 @@ class _ButtonChildWidgetState extends State<ButtonChildWidget> {
required ButtonAction? buttonAction,
Exception? exception,
}) {
- if (Navigator.of(context).canPop()) {
- Navigator.of(context).pop(ButtonResult(widget.buttonAction, exception));
- } else if (exception != null) {
- //This is to show the execution was unsuccessful if the dialog is manually
- //closed before the execution completes.
- showGenericErrorDialog(context: context);
+ if (mounted) {
+ if (Navigator.of(context).canPop()) {
+ Navigator.of(context).pop(ButtonResult(widget.buttonAction, exception));
+ } else if (exception != null) {
+ //This is to show the execution was unsuccessful if the dialog is manually
+ //closed before the execution completes.
+ showGenericErrorDialog(context: context);
+ }
}
}