Fix NullPointerException when closing Connect to server dialog