Skip to content

Commit f8d10c2

Browse files
authored
Fix disconnecting Remote as follower when no leader is attached (#17856)
Fixes #17822 Summary of the issue: An error occurs when disconnecting Remote when in follower mode if no leader is attached. Description of user facing changes No error occurs. Description of development approach The error occurs because, when a follower session disconnects, it makes sure that the secure desktop handler no longer holds a reference to it. The setter for that reference, however, attempts to mutate it. Since we're setting it to None, this fails. Thus, in secureDesktop.SecureDesktopHandler's followerSession setter, check that the new session is not None before accessing its properties.
1 parent 4ba01cc commit f8d10c2

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

source/remoteClient/secureDesktop.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,11 @@ def followerSession(self, session: Optional[FollowerSession]) -> None:
106106
transport = self._followerSession.transport
107107
transport.unregisterInbound(RemoteMessageType.SET_BRAILLE_INFO, self._onLeaderDisplayChange)
108108
self._followerSession = session
109-
session.transport.registerInbound(
110-
RemoteMessageType.SET_BRAILLE_INFO,
111-
self._onLeaderDisplayChange,
112-
)
109+
if session is not None:
110+
session.transport.registerInbound(
111+
RemoteMessageType.SET_BRAILLE_INFO,
112+
self._onLeaderDisplayChange,
113+
)
113114

114115
def _onSecureDesktopChange(self, isSecureDesktop: Optional[bool] = None) -> None:
115116
"""Internal callback for secure desktop state changes.

0 commit comments

Comments
 (0)