Skip to content

Commit

Permalink
DRAGONAGE: Catch exceptions in NWScript function StringToVector
Browse files Browse the repository at this point in the history
On error, it should return an empty vector.
  • Loading branch information
DrMcCoy committed Nov 13, 2016
1 parent 7b0a52f commit 3fdab19
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/engines/dragonage/script/functions_string.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,9 +206,13 @@ void Functions::stringToVector(Aurora::NWScript::FunctionContext &ctx) {
if (Common::UString::split(ctx.getParams()[0].getString(), ' ', parts) != 3)
return;

Common::parseString(parts[0], x);
Common::parseString(parts[1], y);
Common::parseString(parts[2], z);
try {
Common::parseString(parts[0], x);
Common::parseString(parts[1], y);
Common::parseString(parts[2], z);
} catch (...) {
return;
}

ctx.getReturn().setVector(x, y, z);
}
Expand Down

0 comments on commit 3fdab19

Please sign in to comment.