diff --git a/Source/Core/Core/IOS/ES/Formats.cpp b/Source/Core/Core/IOS/ES/Formats.cpp index a43ff50de5..c28651bae7 100644 --- a/Source/Core/Core/IOS/ES/Formats.cpp +++ b/Source/Core/Core/IOS/ES/Formats.cpp @@ -339,7 +339,7 @@ bool TMDReader::GetContent(u16 index, Content* content) const std::vector TMDReader::GetContents() const { - std::vector contents(GetNumContents()); + std::vector contents(IsValid() ? GetNumContents() : 0); for (size_t i = 0; i < contents.size(); ++i) GetContent(static_cast(i), &contents[i]); return contents; diff --git a/Source/Core/DiscIO/VolumeWad.cpp b/Source/Core/DiscIO/VolumeWad.cpp index 95c6a68dc6..39961a6c18 100644 --- a/Source/Core/DiscIO/VolumeWad.cpp +++ b/Source/Core/DiscIO/VolumeWad.cpp @@ -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(); }