[Crash] Crash fix where invalid input to #heromodel would crash zone (#2937)

This commit is contained in:
Chris Miles 2023-02-15 13:36:09 -06:00 committed by GitHub
parent 0829bc08b8
commit 2ae795fd61
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -21,7 +21,7 @@ void command_heromodel(Client *c, const Seperator *sep)
t = c->GetTarget();
}
auto hero_forge_model = std::stoul(sep->arg[1]);
auto hero_forge_model = Strings::IsNumber(sep->arg[1]) ? std::stoul(sep->arg[1]) : 0;
if (arguments > 1) {
auto slot = static_cast<uint8>(std::stoul(sep->arg[2]));