From 0c39b5c021ea535a7a65aca845ed5f16ae8fae1b Mon Sep 17 00:00:00 2001 From: hunbernd Date: Sun, 22 Oct 2017 19:44:14 +0200 Subject: [PATCH] Fix bug causing RS to crash at startup when some icons were removed from toolbar For example: disabled plugins --- retroshare-gui/src/gui/MainWindow.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/retroshare-gui/src/gui/MainWindow.cpp b/retroshare-gui/src/gui/MainWindow.cpp index 0933f8e7b..74bc4ab27 100644 --- a/retroshare-gui/src/gui/MainWindow.cpp +++ b/retroshare-gui/src/gui/MainWindow.cpp @@ -207,8 +207,9 @@ MainWindow::MainWindow(QWidget* parent, Qt::WindowFlags flags) connect(ui->listWidget, SIGNAL(currentRowChanged(int)), this, SLOT(setNewPage(int))); connect(ui->stackPages, SIGNAL(currentChanged(int)), this, SLOT(setNewPage(int))); - //ui->stackPages->setCurrentIndex(Settings->getLastPageInMainWindow()); - setNewPage(Settings->getLastPageInMainWindow()); + int lastpageindex = Settings->getLastPageInMainWindow(); + if(lastpageindex < ui->stackPages->count()) //Do not crash when a page was removed after last run + setNewPage(lastpageindex); ui->splitter->setStretchFactor(0, 0); ui->splitter->setStretchFactor(1, 1);