From acec02ffc60918b74629d150334d4893a345edfb Mon Sep 17 00:00:00 2001 From: JosJuice Date: Sun, 30 Oct 2016 23:39:12 +0100 Subject: Remove Blob nullptr checks from Volume code There's no point in creating a volume without a blob, since essentially all the functionality of a volume requires a blob to be used. Also, VolumeCreator doesn't support creating volumes without blobs (it can't even figure out the volume type unless it gets a blob), so it's currently impossible for a volume to be created without a blob. --- Source/Core/DiscIO/VolumeGC.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'Source/Core/DiscIO/VolumeGC.cpp') diff --git a/Source/Core/DiscIO/VolumeGC.cpp b/Source/Core/DiscIO/VolumeGC.cpp index 10d1047e54..60b9846504 100644 --- a/Source/Core/DiscIO/VolumeGC.cpp +++ b/Source/Core/DiscIO/VolumeGC.cpp @@ -9,6 +9,7 @@ #include #include +#include "Common/Assert.h" #include "Common/ColorUtil.h" #include "Common/CommonTypes.h" #include "Common/Logging/Log.h" @@ -25,6 +26,7 @@ namespace DiscIO { CVolumeGC::CVolumeGC(std::unique_ptr reader) : m_pReader(std::move(reader)) { + _assert_(m_pReader); } CVolumeGC::~CVolumeGC() @@ -36,9 +38,6 @@ bool CVolumeGC::Read(u64 _Offset, u64 _Length, u8* _pBuffer, bool decrypt) const if (decrypt) PanicAlertT("Tried to decrypt data from a non-Wii volume"); - if (m_pReader == nullptr) - return false; - FileMon::FindFilename(_Offset); return m_pReader->Read(_Offset, _Length, _pBuffer); @@ -162,17 +161,17 @@ std::string CVolumeGC::GetApploaderDate() const BlobType CVolumeGC::GetBlobType() const { - return m_pReader ? m_pReader->GetBlobType() : BlobType::PLAIN; + return m_pReader->GetBlobType(); } u64 CVolumeGC::GetSize() const { - return m_pReader ? m_pReader->GetDataSize() : 0; + return m_pReader->GetDataSize(); } u64 CVolumeGC::GetRawSize() const { - return m_pReader ? m_pReader->GetRawSize() : 0; + return m_pReader->GetRawSize(); } u8 CVolumeGC::GetDiscNumber() const -- cgit v1.2.3