Skip to content

Commit 359cb72

Browse files
committed
Crash fix
1 parent d887f2e commit 359cb72

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

src/main/java/nekiplay/meteorplus/mixin/meteorclient/modules/CriticalsMixin.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,13 @@ private void onSendPacket(PacketEvent.Send event, CallbackInfo ci) {
4545
if (skipCrit()) { ci.cancel(); return; }
4646

4747
Entity entity = packet.getEntity();
48-
if (entity.getType() == EntityType.SHULKER_BULLET || entity.getType() == EntityType.FIREBALL) {
49-
ci.cancel();
50-
}
51-
else if (entity instanceof LivingEntity livingEntity) {
52-
if (!needCrit(livingEntity) && noWorkIfItsNotNeed.get()) {
48+
if (entity != null) {
49+
if (entity.getType() == EntityType.SHULKER_BULLET || entity.getType() == EntityType.FIREBALL) {
5350
ci.cancel();
51+
} else if (entity instanceof LivingEntity livingEntity) {
52+
if (!needCrit(livingEntity) && noWorkIfItsNotNeed.get()) {
53+
ci.cancel();
54+
}
5455
}
5556
}
5657
}

0 commit comments

Comments
 (0)