From 7a68218439c757f7adb6c9cde7714e02114cf89e Mon Sep 17 00:00:00 2001 From: edde746 <86283021+edde746@users.noreply.github.com> Date: Fri, 20 Mar 2026 08:07:29 +0100 Subject: [PATCH] fix: guard setState with mounted in pairing screen --- lib/screens/companion_remote/pairing_screen.dart | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/screens/companion_remote/pairing_screen.dart b/lib/screens/companion_remote/pairing_screen.dart index ac8231e1..2110980b 100644 --- a/lib/screens/companion_remote/pairing_screen.dart +++ b/lib/screens/companion_remote/pairing_screen.dart @@ -67,6 +67,7 @@ class _PairingScreenState extends State { } } catch (e) { appLogger.e('Failed to join remote session', error: e); + if (!mounted) return; setState(() { _isConnecting = false; _errorMessage = _parseErrorMessage(e.toString()); @@ -129,6 +130,7 @@ class _PairingScreenState extends State { } } catch (e) { appLogger.e('Failed to join remote session', error: e); + if (!mounted) return; _lastScannedCode = null; // Allow re-scanning setState(() { _isConnecting = false;