mirror of https://github.com/deavminet/gustav.git
Don't crash when you select "Channel list" when you have no open sessions
This commit is contained in:
parent
62895ccaee
commit
ce9a675da0
13
source/gui.d
13
source/gui.d
|
@ -462,6 +462,19 @@ public class GUI : Thread
|
|||
box.add(new JoinButtonCustom(customChannelEntry));
|
||||
channelsList.add(box);
|
||||
|
||||
/* If there are no available connections */
|
||||
if(!connections.length)
|
||||
{
|
||||
import gtk.MessageDialog;
|
||||
MessageDialog errorDialog = new MessageDialog(mainWindow, GtkDialogFlags.MODAL, GtkMessageType.ERROR, GtkButtonsType.CLOSE, false, "Cannot list channels\n\nYou are not connected to a server");
|
||||
errorDialog.setIconName("user-available");
|
||||
// errorDialog.set
|
||||
errorDialog.run();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/* Get the current connection */
|
||||
Connection currentConnection = connections[notebook.getCurrentPage()];
|
||||
|
||||
|
|
Loading…
Reference in New Issue