Skip to content

Commit

Permalink
Avoid assert due to using proxyModel too early.
Browse files Browse the repository at this point in the history
mapFromSource can't be called when the proxyModel
has no source model set yet.
  • Loading branch information
rdoeffinger committed Sep 5, 2018
1 parent 1eca75d commit 68490dc
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/mainwindow.cpp
Expand Up @@ -411,8 +411,12 @@ void MainWindow::config() {
this->show();

updateProfileBox();
ui->treeView->setRootIndex(proxyModel.mapFromSource(
model.setRootPath(QtPassSettings::getPassStore())));
// For freshStart, proxyModel is not yet configured
// and maniplating it will assert
if (!freshStart) {
ui->treeView->setRootIndex(proxyModel.mapFromSource(
model.setRootPath(QtPassSettings::getPassStore())));
}

if (freshStart && Util::checkConfig())
config();
Expand Down

0 comments on commit 68490dc

Please sign in to comment.