mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-03-17 19:20:49 +00:00
Merge branch 'assert_again' into 'master'
Replace another `assert` with a `throw` See merge request OpenMW/openmw!3043
This commit is contained in:
commit
def5839c8d
@ -527,7 +527,10 @@ namespace ESM4
|
||||
// else the method may try to dereference an element that does not exist
|
||||
const GroupTypeHeader& Reader::grp(std::size_t pos) const
|
||||
{
|
||||
assert(pos <= mCtx.groupStack.size() - 1 && "ESM4::Reader::grp - exceeded stack depth");
|
||||
if (mCtx.groupStack.size() == 0)
|
||||
throw std::runtime_error("ESM4::Reader::grp mCtx.groupStack.size is zero");
|
||||
if (pos <= mCtx.groupStack.size() - 1)
|
||||
throw std::runtime_error("ESM4::Reader::grp - exceeded stack depth");
|
||||
|
||||
return (*(mCtx.groupStack.end() - pos - 1)).first;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user