diff --git a/web/repertory/lib/widgets/mount_widget.dart b/web/repertory/lib/widgets/mount_widget.dart index 8bb6d051..9b2c4296 100644 --- a/web/repertory/lib/widgets/mount_widget.dart +++ b/web/repertory/lib/widgets/mount_widget.dart @@ -84,6 +84,12 @@ class _MountWidgetState extends State { VoidCallback? _createMountHandler(context, Mount mount) { return _enabled && mount.mounted != null ? () async { + if (mount.mounted == null) { + return; + } + + final mounted = mount.mounted!; + setState(() { _enabled = false; }); @@ -96,12 +102,12 @@ class _MountWidgetState extends State { }); } - if (!mount.mounted! && location == null) { + if (!mounted && location == null) { displayErrorMessage(context, "Mount location is not set"); return cleanup(); } - final success = await mount.mount(mount.mounted!, location: location); + final success = await mount.mount(mounted, location: location); if (success || mount.mounted! || constants.navigatorKey.currentContext == null ||