1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-16 20:29:57 +00:00

Replace an asert with a conditional throw

The assert is reachable, resulting in a brutal `abort`
instead of a nice exception.
This commit is contained in:
jvoisin 2023-05-20 19:33:14 +02:00
parent 5b36ea0179
commit cde7aeac3d

View file

@ -686,7 +686,8 @@ namespace ESM4
{ {
char ch; char ch;
stream.read(&ch, 1); // read the null terminator 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 #if 0
else else