From 8a612bf285ce9513960c212b18c688a7d38991f6 Mon Sep 17 00:00:00 2001 From: spycrab Date: Wed, 31 Jan 2018 13:51:46 +0100 Subject: [PATCH] Qt/FileystemWidget: Fix crash when right-clicking GC disc --- Source/Core/DolphinQt2/Config/FilesystemWidget.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Source/Core/DolphinQt2/Config/FilesystemWidget.cpp b/Source/Core/DolphinQt2/Config/FilesystemWidget.cpp index 4da2dd11e0..ccbb2b28b1 100644 --- a/Source/Core/DolphinQt2/Config/FilesystemWidget.cpp +++ b/Source/Core/DolphinQt2/Config/FilesystemWidget.cpp @@ -148,11 +148,13 @@ void FilesystemWidget::ShowContextMenu(const QPoint&) QMenu* menu = new QMenu(this); - DiscIO::Partition partition = GetPartitionFromID(item->data(ENTRY_PARTITION).toInt()); - QString path = item->data(ENTRY_NAME).toString(); - EntryType type = item->data(ENTRY_TYPE).value(); + DiscIO::Partition partition = type == EntryType::Disc ? + DiscIO::PARTITION_NONE : + GetPartitionFromID(item->data(ENTRY_PARTITION).toInt()); + QString path = item->data(ENTRY_NAME).toString(); + if ((type == EntryType::Disc && m_volume->GetPartitions().empty()) || type == EntryType::Partition) {