Default Channel Bar module errors if the selected channel gets deleted

The default ChatSystem’s channel bar feature will error and not remove a channel from the list if the channel is selected when it is removed by the server

This is most likely caused by this line in the RemoveChannel function in ChatWindow
image

Repro File
ChannelBarErrorRepo.rbxl (134.9 KB)
None of the chat scripts have been modified minus ChatSettings in order to make the channel bar appear.

Repro Instructions:

  1. Select the ‘Test’ channel in the channel bar when it appears