fix(#406): guard mounted after danger-confirm dialog (Gemini review)

_confirmDanger awaited showDialog then called _apply unconditionally; if the
screen was disposed while the dialog was open, _apply's setState would throw.
Guard with && mounted.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
pull/455/head
Strycher 4 months ago
parent 49a02221d3
commit c8874cc00b

@ -234,7 +234,9 @@ class _ConfigProfilePreviewScreenState
],
),
);
if (ok == true) await _apply(dangerWrites, 'Credential changes');
// Guard the async gap: the screen may have been disposed while the dialog
// was open; _apply's setState would then throw (Gemini review).
if (ok == true && mounted) await _apply(dangerWrites, 'Credential changes');
}
}

Loading…
Cancel
Save

Powered by TurnKey Linux.