diff --git a/src/mainwindow_scriptapi.cpp b/src/mainwindow_scriptapi.cpp index f0ccc0bc..2ac40c10 100644 --- a/src/mainwindow_scriptapi.cpp +++ b/src/mainwindow_scriptapi.cpp @@ -1020,7 +1020,7 @@ void MainWindow::setMainTab(int index) { } int MainWindow::getMapViewTab() { - if (this->getMainTab() != 0 || !this->ui->mapViewTab) + if (!this->ui || !this->ui->mapViewTab) return -1; return this->ui->mapViewTab->currentIndex(); }