Fix rare NPE
This commit is contained in:
1 parent
af5446f33e
commit
bf609a1964
2 files changed
+3
-1
No files matched your search
@@ -2,6 +2,7 @@ package me.caseload.knockbacksync;
|
||||
|
||||
import com.github.retrooper.packetevents.PacketEvents;
|
||||
import com.github.retrooper.packetevents.manager.server.ServerVersion;
|
||||
import com.github.retrooper.packetevents.protocol.world.Location;
|
||||
import io.github.retrooper.packetevents.factory.spigot.SpigotPacketEventsBuilder;
|
||||
import me.caseload.knockbacksync.event.events.ConfigReloadEvent;
|
||||
import me.caseload.knockbacksync.event.KBSyncEventHandler;
|
||||
@@ -26,6 +27,7 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.plugin.PluginManager;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
import org.bukkit.util.Vector;
|
||||
import org.incendo.cloud.bukkit.CloudBukkitCapabilities;
|
||||
import org.incendo.cloud.execution.ExecutionCoordinator;
|
||||
import org.incendo.cloud.paper.LegacyPaperCommandManager;
|
||||
|
||||
@@ -305,7 +305,7 @@ public class PlayerData {
|
||||
}
|
||||
|
||||
public void quitCombat() {
|
||||
combatTask.cancel(); // should do nothing
|
||||
if (combatTask != null) combatTask.cancel(); // rarely throws NPE without null check
|
||||
combatTask = null;
|
||||
CombatManager.removePlayer(uuid);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user