mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-13 10:31:29 +00:00
[Fix] Guard against crash condition (#4062)
This commit is contained in:
parent
1567141c19
commit
20c01ef343
@ -146,6 +146,9 @@ void Client::SendGuildRankNames()
|
||||
{
|
||||
if (IsInAGuild() && (ClientVersion() >= EQ::versions::ClientVersion::RoF)) {
|
||||
auto guild = guild_mgr.GetGuildByGuildID(GuildID());
|
||||
if (!guild) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 1; i <= GUILD_MAX_RANK; i++) {
|
||||
|
||||
@ -153,6 +156,10 @@ void Client::SendGuildRankNames()
|
||||
GuildUpdateUCPStruct* gucp = (GuildUpdateUCPStruct*)outapp->pBuffer;
|
||||
|
||||
gucp->payload.rank_name.rank = i;
|
||||
if (guild->rank_names[i].empty()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
strn0cpy(
|
||||
gucp->payload.rank_name.rank_name,
|
||||
guild->rank_names[i].c_str(),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user