From cee84115b9d4c7c05d1bed5a9100ae28b1822f0a Mon Sep 17 00:00:00 2001 From: Blake-Madden <66873089+Blake-Madden@users.noreply.github.com> Date: Fri, 31 May 2024 09:16:45 -0400 Subject: [PATCH] If mapped file size is reported as zero, then throw as an empty file exception --- src/util/memorymappedfile.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/util/memorymappedfile.cpp b/src/util/memorymappedfile.cpp index 194fc4fe..c2aaf837 100644 --- a/src/util/memorymappedfile.cpp +++ b/src/util/memorymappedfile.cpp @@ -152,6 +152,11 @@ bool MemoryMappedFile::MapFile(const wxString& filePath, m_open = true; return true; } + else if (m_mapSize == 0) + { + Reset(); + throw MemoryMappedFileEmptyException(); + } else { Reset();