fix potential segfault on moveEvent

This commit is contained in:
garak 2021-11-05 15:39:19 -04:00
parent 755e922a93
commit 795336f42c

View file

@ -2710,7 +2710,7 @@ void MainWindow::onMapRulerStatusChanged(const QString &status) {
void MainWindow::moveEvent(QMoveEvent *event) { void MainWindow::moveEvent(QMoveEvent *event) {
QMainWindow::moveEvent(event); QMainWindow::moveEvent(event);
if (label_MapRulerStatus->isVisible() && label_MapRulerStatus->parentWidget()) if (label_MapRulerStatus && label_MapRulerStatus->isVisible() && label_MapRulerStatus->parentWidget())
label_MapRulerStatus->move(label_MapRulerStatus->parentWidget()->mapToGlobal(QPoint(6, 6))); label_MapRulerStatus->move(label_MapRulerStatus->parentWidget()->mapToGlobal(QPoint(6, 6)));
} }