From 6dc35a3772e1ffe1573af8b14a656dec73c6d0a0 Mon Sep 17 00:00:00 2001 From: Megamouse Date: Thu, 29 Jul 2021 00:40:39 +0200 Subject: [PATCH] Qt: add nullptr checks in msg_dialog_frame --- rpcs3/rpcs3qt/msg_dialog_frame.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/rpcs3/rpcs3qt/msg_dialog_frame.cpp b/rpcs3/rpcs3qt/msg_dialog_frame.cpp index b42d83da58..84dbcd51d7 100644 --- a/rpcs3/rpcs3qt/msg_dialog_frame.cpp +++ b/rpcs3/rpcs3qt/msg_dialog_frame.cpp @@ -101,14 +101,14 @@ void msg_dialog_frame::Create(const std::string& msg, const std::string& title) connect(m_button_yes, &QAbstractButton::clicked, [this]() { g_last_user_response = CELL_MSGDIALOG_BUTTON_YES; - on_close(CELL_MSGDIALOG_BUTTON_YES); + if (on_close) on_close(CELL_MSGDIALOG_BUTTON_YES); m_dialog->accept(); }); connect(m_button_no, &QAbstractButton::clicked, [this]() { g_last_user_response = CELL_MSGDIALOG_BUTTON_NO; - on_close(CELL_MSGDIALOG_BUTTON_NO); + if (on_close) on_close(CELL_MSGDIALOG_BUTTON_NO); m_dialog->accept(); }); } @@ -133,7 +133,7 @@ void msg_dialog_frame::Create(const std::string& msg, const std::string& title) connect(m_button_ok, &QAbstractButton::clicked, [this]() { g_last_user_response = CELL_MSGDIALOG_BUTTON_OK; - on_close(CELL_MSGDIALOG_BUTTON_OK); + if (on_close) on_close(CELL_MSGDIALOG_BUTTON_OK); m_dialog->accept(); }); } @@ -145,7 +145,7 @@ void msg_dialog_frame::Create(const std::string& msg, const std::string& title) if (!type.disable_cancel) { g_last_user_response = CELL_MSGDIALOG_BUTTON_ESCAPE; - on_close(CELL_MSGDIALOG_BUTTON_ESCAPE); + if (on_close) on_close(CELL_MSGDIALOG_BUTTON_ESCAPE); } });