store_account = modest_tny_account_store_get_server_account (modest_runtime_get_account_store (),
account_name,
TNY_ACCOUNT_TYPE_STORE);
-
- /* Reconnect the store account, no need to reconnect the
- transport account because it will connect when needed */
- if (tny_account_get_connection_status (store_account) ==
- TNY_CONNECTION_STATUS_DISCONNECTED)
- tny_camel_account_set_online (TNY_CAMEL_ACCOUNT (store_account),
- TRUE, NULL, NULL);
-
+ if (store_account) {
+ /* Reconnect the store account, no need to reconnect the
+ transport account because it will connect when needed */
+ if (tny_account_get_connection_status (store_account) ==
+ TNY_CONNECTION_STATUS_DISCONNECTED)
+ tny_camel_account_set_online (TNY_CAMEL_ACCOUNT (store_account),
+ TRUE, NULL, NULL);
+ g_object_unref (store_account);
+ }
/* Disconnect this handler */
g_signal_handlers_disconnect_by_func (dialog, on_account_settings_dialog_response, user_data);
/* Free */
g_free (account_name);
- g_object_unref (store_account);
}
static void