1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-03-17 19:20:49 +00:00

Merge branch 'assert_throw' into 'master'

Replace an `assert` with a conditional throw

See merge request OpenMW/openmw!3038
This commit is contained in:
Alexei Kotov 2023-05-21 15:44:52 +00:00
commit 08dc48586e

View File

@ -686,7 +686,8 @@ namespace ESM4
{
char ch;
stream.read(&ch, 1); // read the null terminator
assert(ch == '\0' && "ESM4::Reader::getString string is not terminated with a null");
if (ch != '\0')
throw std::runtime_error("ESM4::Reader::getString string is not terminated with a null");
}
#if 0
else