From 48e21f1450d4c20c89e111ff72306022054037ad Mon Sep 17 00:00:00 2001 From: Rosalie Wanders Date: Wed, 25 Dec 2024 13:41:32 +0100 Subject: [PATCH] RMG: add nullptr check to CreateNetplaySessionDialog::accept() --- .../Dialog/Netplay/CreateNetplaySessionDialog.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Source/RMG/UserInterface/Dialog/Netplay/CreateNetplaySessionDialog.cpp b/Source/RMG/UserInterface/Dialog/Netplay/CreateNetplaySessionDialog.cpp index 4d519ba1..a09bcf64 100644 --- a/Source/RMG/UserInterface/Dialog/Netplay/CreateNetplaySessionDialog.cpp +++ b/Source/RMG/UserInterface/Dialog/Netplay/CreateNetplaySessionDialog.cpp @@ -290,7 +290,12 @@ void CreateNetplaySessionDialog::accept() QPushButton* createButton = this->buttonBox->button(QDialogButtonBox::Ok); createButton->setEnabled(false); - QListWidgetItem* item = this->listWidget->currentItem(); + QListWidgetItem* item = this->listWidget->currentItem(); + if (item == nullptr) + { + return; + } + NetplayRomData_t romData = item->data(Qt::UserRole).value(); this->sessionFile = romData.File;