From a143d2892e421853755c033a178b792fca300ae0 Mon Sep 17 00:00:00 2001 From: Marcus Huderle Date: Sun, 26 Dec 2021 12:17:47 -0600 Subject: [PATCH] Allow getting the map view tab index even if a different main tab is currently opened --- src/mainwindow_scriptapi.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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(); }