Merge pull request #6345 from spycrab/qt_fix_fsw

Qt/FileystemWidget: Fix crash when right-clicking GC disc
This commit is contained in:
Stenzek 2018-02-03 00:56:55 +10:00 committed by GitHub
commit cf5bf3899f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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<EntryType>();
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)
{