diff --git a/src/app/valentina/mainwindow.cpp b/src/app/valentina/mainwindow.cpp index 0db695b9c..f54847b52 100644 --- a/src/app/valentina/mainwindow.cpp +++ b/src/app/valentina/mainwindow.cpp @@ -3989,9 +3989,9 @@ void MainWindow::CreateActions() QAction *action = new QAction(this); action->setVisible(false); recentFileActs[i] = action; - connect(recentFileActs[i], &QAction::triggered, this, [action, this]() + connect(recentFileActs[i], &QAction::triggered, this, [this]() { - if (action != nullptr) + if (QAction *action = qobject_cast(sender())) { const QString filePath = action->data().toString(); if (not filePath.isEmpty())