Fixed bug where closing the client window before connecting to a server caused an uncaught AttributeError