From dd5a97704805bb741b0f540eab07c7b9a679e29a Mon Sep 17 00:00:00 2001 From: fullwall Date: Sat, 8 Jan 2022 13:31:37 +0800 Subject: [PATCH] Add null check --- .../java/net/citizensnpcs/api/astar/pathfinder/VectorNode.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/net/citizensnpcs/api/astar/pathfinder/VectorNode.java b/src/main/java/net/citizensnpcs/api/astar/pathfinder/VectorNode.java index 15aa8069..2861cc3b 100644 --- a/src/main/java/net/citizensnpcs/api/astar/pathfinder/VectorNode.java +++ b/src/main/java/net/citizensnpcs/api/astar/pathfinder/VectorNode.java @@ -29,7 +29,7 @@ public VectorNode(VectorGoal goal, Location location, BlockSource source, BlockE public VectorNode(VectorNode parent, Vector location, PathInfo info) { super(parent); - this.store = parent.store != null && parent.store.size() > 0 ? parent.store.clone() : null; + this.store = parent != null && parent.store != null && parent.store.size() > 0 ? parent.store.clone() : null; this.location = new Vector(location.getBlockX(), location.getBlockY(), location.getBlockZ()); this.info = info; }