DiscIO: Add extra IsValid checks for VolumeWAD::m_tmd

Plus an IsValid check inside TMDReader::GetContents, which is called by
VolumeWAD.

Fixes https://bugs.dolphin-emu.org/issues/14032.
This commit is contained in:
JosJuice
2026-04-20 19:17:03 +02:00
parent 914f5c5621
commit 97fff931fd
2 changed files with 7 additions and 1 deletions
+1 -1
View File
@@ -339,7 +339,7 @@ bool TMDReader::GetContent(u16 index, Content* content) const
std::vector<Content> TMDReader::GetContents() const
{
std::vector<Content> contents(GetNumContents());
std::vector<Content> contents(IsValid() ? GetNumContents() : 0);
for (size_t i = 0; i < contents.size(); ++i)
GetContent(static_cast<u16>(i), &contents[i]);
return contents;
+6
View File
@@ -230,11 +230,17 @@ IOS::ES::TicketReader VolumeWAD::GetTicketWithFixedCommonKey() const
std::string VolumeWAD::GetGameID(const Partition& partition) const
{
if (!m_tmd.IsValid())
return {};
return m_tmd.GetGameID();
}
std::string VolumeWAD::GetGameTDBID(const Partition& partition) const
{
if (!m_tmd.IsValid())
return {};
return m_tmd.GetGameTDBID();
}