mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-26 20:02:25 +01:00
Core/ChatCommands: Do not try to consume integral types if the token is empty (PR #25320)
This commit is contained in:
committed by
GitHub
parent
1aceb41349
commit
6079bc7f34
@@ -55,6 +55,9 @@ struct ArgInfo<T, std::enable_if_t<std::is_integral_v<T>>>
|
||||
char const* next = args;
|
||||
std::string_view token(args, Trinity::Impl::ChatCommands::tokenize(next));
|
||||
|
||||
if (!token.length())
|
||||
return nullptr;
|
||||
|
||||
std::from_chars_result result;
|
||||
if (StringStartsWith(token, "0x"))
|
||||
result = std::from_chars(token.data() + 2, token.data() + token.length(), val, 16);
|
||||
|
||||
Reference in New Issue
Block a user