Skip to content

Commit

Permalink
Fix client crashing when player_remove contains unknown player (#2918)
Browse files Browse the repository at this point in the history
  • Loading branch information
frej4189 authored Jan 29, 2023
1 parent 98426b5 commit b21ae38
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/plugins/entities.js
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ function inject (bot) {
for (const uuid of packet.players) {
const player = bot.uuidToUsername[uuid] ? bot.players[bot.uuidToUsername[uuid]] : null

if (player.entity === bot.entity) continue
if (!player || player.entity === bot.entity) continue

player.entity = null
delete bot.players[player.username]
Expand Down

0 comments on commit b21ae38

Please sign in to comment.