diff --git a/plugins/libimhex/source/helpers/file.cpp b/plugins/libimhex/source/helpers/file.cpp index 11cb92de9..cbfce32da 100644 --- a/plugins/libimhex/source/helpers/file.cpp +++ b/plugins/libimhex/source/helpers/file.cpp @@ -57,6 +57,8 @@ namespace hex { std::string File::readString(size_t numBytes) { if (!isValid()) return { }; + if (getSize() == 0) return { }; + return reinterpret_cast(readBytes(numBytes).data()); }