diff options
| author | JosJuice <josjuice@gmail.com> | 2016-10-30 23:39:12 +0100 |
|---|---|---|
| committer | JosJuice <josjuice@gmail.com> | 2017-03-13 14:13:55 +0100 |
| commit | acec02ffc60918b74629d150334d4893a345edfb (patch) | |
| tree | 2d330a7e1f8f7002653fc7c966e40756127c41b7 /Source/Core/DiscIO/VolumeGC.cpp | |
| parent | f63d40270dbd6ee32b39819886924452accb34b2 (diff) | |
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.
Diffstat (limited to 'Source/Core/DiscIO/VolumeGC.cpp')
| -rw-r--r-- | Source/Core/DiscIO/VolumeGC.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
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 <utility> #include <vector> +#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<IBlobReader> 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 |
