From eaa61ab0197a9f28c5099e2e5e2e48efa70fce0f Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Fri, 17 Nov 2017 18:35:59 +0100 Subject: Try to fix segfault when selecting last session (needs verification) --- src/dialog.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/dialog.cpp') diff --git a/src/dialog.cpp b/src/dialog.cpp index 0de9e93..c07a71d 100644 --- a/src/dialog.cpp +++ b/src/dialog.cpp @@ -255,12 +255,14 @@ bool Dialog::selectSession(const QString& name) { for (int i = 0; i < model_[tab]->rowCount(root); ++i) { QModelIndex section(model_[tab]->index(i, 0, root)); if (!section.isValid()) { - break; + continue; } for (int j = 0; j < model_[tab]->rowCount(section); ++j) { QModelIndex index(model_[tab]->index(j, 0, section)); + if (!index.isValid()) + continue; SessionTreeItem* item = static_cast(index.internalPointer()); - const Session* s(item->session()); + const Session* s = item->session(); if (s == NULL) { continue; } -- cgit v1.2.3-55-g7522