Commit 6673656f authored by Guillaume Roguez's avatar Guillaume Roguez Committed by Nicolas Jager

fix crash when no account selected

Change-Id: I5ac1e2a4beddbd4476df6f60047790097cd1a5e5
Reviewed-by: default avatarNicolas Jäger <nicolas.jager@savoirfairelinux.com>
parent 71aced9b
......@@ -779,13 +779,15 @@ CppImpl::changeView(GType type, lrc::api::conversation::Info conversation)
// TODO select first conversation?
new_view = widgets->welcome_view;
// refresh the tabs
auto hasPendingRequests = accountContainer_->info.contactModel->hasPendingRequests();
if (accountContainer_) {
// refresh the tabs
auto hasPendingRequests = accountContainer_->info.contactModel->hasPendingRequests();
gtk_notebook_set_show_tabs(GTK_NOTEBOOK(widgets->notebook_contacts), hasPendingRequests);
gtk_notebook_set_show_tabs(GTK_NOTEBOOK(widgets->notebook_contacts), hasPendingRequests);
if (not hasPendingRequests) {
gtk_notebook_prev_page(GTK_NOTEBOOK(widgets->notebook_contacts));
if (not hasPendingRequests) {
gtk_notebook_prev_page(GTK_NOTEBOOK(widgets->notebook_contacts));
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment