Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4764: FIX(talking-ui): Crash after rename
If the local user was added to the TalkingUI, renamed after that and then changes its talking status, the client would crash. The reason for this is that in TalkingUI::findOrAddUser we first create the user's channel. Therefore we expect the channel to exist at a later point in this function. However we also check whether the current name of the user matches the name we have stored for it. If not (which is the case after a rename), we remove that user. If the user was the only one in its channel, the channel gets removed as well. In this case however the original assumption of the user's channel already existing is not valid anymore, ultimately leading to the crash. The fix is to only create the user's channel after the name check in order to make sure the assumption is always correct. Furthermore we also explicitly check for the existence of the channel instead of simply relying on it being present.
- Loading branch information