Fix crash in sieve manager window when no account has sieve enabled.
authorAndrej Kacian <ticho@claws-mail.org>
Mon, 24 Apr 2017 16:59:10 +0000 (18:59 +0200)
committerPaul <paul@claws-mail.org>
Mon, 28 Aug 2017 17:49:41 +0000 (18:49 +0100)
The GtkComboBox gets destroyed in such case, but the 'Refresh'
button handler didn't check for that.

src/plugins/managesieve/sieve_manager.c

index afdb36a64384cd747c673b2fa189e49a23184c36..3120d7e0f5a08a82b7cfbab319d25e639d05c935 100644 (file)
@@ -605,6 +605,9 @@ static void account_changed(GtkWidget *widget, SieveManagerPage *page)
        PrefsAccount *account;
        SieveSession *session;
 
+       if (page->accounts_menu == NULL)
+               return;
+
        account_id = combobox_get_active_data(GTK_COMBO_BOX(page->accounts_menu));
        account = account_find_from_id(account_id);
        if (!account)
@@ -705,6 +708,7 @@ static SieveManagerPage *sieve_manager_page_new()
        if (!default_account) {
                gtk_widget_destroy(label);
                gtk_widget_destroy(accounts_menu);
+               accounts_menu = NULL;
        }
 
        /* status */