summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/dialog.cpp6
1 files changed, 4 insertions, 2 deletions
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<SessionTreeItem*>(index.internalPointer());
- const Session* s(item->session());
+ const Session* s = item->session();
if (s == NULL) {
continue;
}