Avoid crash at GUI start up

The crash can happen before mainWindow is allocated. Don't remember how
that happens, but I have seen it happen!
This commit is contained in:
Srivats P 2022-02-09 21:30:51 +05:30
parent 7dd070fd98
commit 041f500e65

View File

@ -182,6 +182,8 @@ void LogsWindow::alert(State state)
// start - center of main window
QRect start;
QWidget *view = mainWindow;
if (!view)
return;
alert_->setParent(view);
alert_->raise();
start.setSize(QSize(256, 256).scaled(view->size()/2, Qt::KeepAspectRatio));