diff --git a/src/main/mainwindow.cpp b/src/main/mainwindow.cpp index 0a2bdd79..2102af93 100644 --- a/src/main/mainwindow.cpp +++ b/src/main/mainwindow.cpp @@ -930,6 +930,11 @@ QString MainWindow::getConfigWindowState() QSize MainWindow::halfScreenSize() { QScreen *screen = QGuiApplication::screenAt(QCursor::pos()); + if (!screen) { + qCritical() << "Can't get the screen where the cursor is located!"; + return QSize(0 ,0); + } + int w = screen->availableGeometry().width(); int h = screen->availableGeometry().height();