Skip to content

Commit

Permalink
fix: more nullpointers checks
Browse files Browse the repository at this point in the history
  • Loading branch information
dudantas authored Mar 12, 2024
1 parent d2b8eb7 commit 2f1d38b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/server/network/protocol/protocolgame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3949,6 +3949,10 @@ void ProtocolGame::sendStats() {
}

void ProtocolGame::sendBasicData() {
if (!player) {
return;
}

NetworkMessage msg;
msg.addByte(0x9F);
if (player->isPremium() || player->isVip()) {
Expand Down Expand Up @@ -6110,6 +6114,10 @@ void ProtocolGame::sendPartyCreatureShowStatus(std::shared_ptr<Creature> target,
}

void ProtocolGame::sendPartyPlayerVocation(std::shared_ptr<Player> target) {
if (!target) {
return;
}

uint32_t cid = target->getID();
if (!knownCreatureSet.contains(cid)) {
sendPartyCreatureUpdate(target);
Expand All @@ -6129,7 +6137,7 @@ void ProtocolGame::sendPartyPlayerVocation(std::shared_ptr<Player> target) {
}

void ProtocolGame::sendPlayerVocation(std::shared_ptr<Player> target) {
if (!player || oldProtocol) {
if (!player || !target || oldProtocol) {
return;
}

Expand Down

0 comments on commit 2f1d38b

Please sign in to comment.