[Bug Fix] Fix possible crash with #killallnpcs. (#1846)

This commit is contained in:
Kinglykrab 2021-11-27 09:45:13 -05:00 committed by GitHub
parent 4507b063f5
commit 298ae3e3ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -11,6 +11,10 @@ void command_killallnpcs(Client *c, const Seperator *sep)
for (auto& npc_entity : entity_list.GetNPCList()) {
auto entity_id = npc_entity.first;
auto npc = npc_entity.second;
if (!npc) {
continue;
}
std::string entity_name = str_tolower(npc->GetName());
if (
(