mirror of
https://github.com/OpenMW/openmw.git
synced 2025-10-15 05:26:36 +00:00
Check length before dereferencing
This commit is contained in:
parent
79a1f1c3d2
commit
e88e60f475
1 changed files with 1 additions and 1 deletions
|
@ -196,7 +196,7 @@ namespace LuaUtil
|
|||
throw std::runtime_error(std::format("No flags found in: {}", line));
|
||||
std::string_view tagsStr = line.substr(0, semicolonPos);
|
||||
std::string_view scriptPath = line.substr(semicolonPos + 1);
|
||||
while (isSpace(scriptPath[0]))
|
||||
while (!scriptPath.empty() && isSpace(scriptPath[0]))
|
||||
scriptPath = scriptPath.substr(1);
|
||||
|
||||
ESM::LuaScriptCfg& script = cfg.mScripts.emplace_back();
|
||||
|
|
Loading…
Reference in a new issue