This commit is contained in:
Scott E. Graves 2025-03-18 14:11:48 -05:00
parent 9fcc50fcc3
commit 10a0e926ad

View File

@ -84,6 +84,12 @@ class _MountWidgetState extends State<MountWidget> {
VoidCallback? _createMountHandler(context, Mount mount) { VoidCallback? _createMountHandler(context, Mount mount) {
return _enabled && mount.mounted != null return _enabled && mount.mounted != null
? () async { ? () async {
if (mount.mounted == null) {
return;
}
final mounted = mount.mounted!;
setState(() { setState(() {
_enabled = false; _enabled = false;
}); });
@ -96,12 +102,12 @@ class _MountWidgetState extends State<MountWidget> {
}); });
} }
if (!mount.mounted! && location == null) { if (!mounted && location == null) {
displayErrorMessage(context, "Mount location is not set"); displayErrorMessage(context, "Mount location is not set");
return cleanup(); return cleanup();
} }
final success = await mount.mount(mount.mounted!, location: location); final success = await mount.mount(mounted, location: location);
if (success || if (success ||
mount.mounted! || mount.mounted! ||
constants.navigatorKey.currentContext == null || constants.navigatorKey.currentContext == null ||