From b7e9547cd544cd7cc18c336bb44c5e857cef45e0 Mon Sep 17 00:00:00 2001 From: Hazel Trinity Date: Fri, 14 Aug 2020 19:04:11 -0700 Subject: [PATCH] Fixed NullPointerException in Spline and Sweep brush --- .../java/com/boydti/fawe/object/brush/sweep/SweepBrush.java | 2 +- .../main/java/com/boydti/fawe/object/visitor/DFSVisitor.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/brush/sweep/SweepBrush.java b/worldedit-core/src/main/java/com/boydti/fawe/object/brush/sweep/SweepBrush.java index e2d05508f..f8b387512 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/brush/sweep/SweepBrush.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/brush/sweep/SweepBrush.java @@ -46,7 +46,7 @@ public class SweepBrush implements Brush, ResettableTool { return; } - boolean newPos = !position.equals(this.position); + boolean newPos = this.position == null || !position.equals(this.position); this.position = position; Player player = editSession.getPlayer(); if (player == null) { diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/visitor/DFSVisitor.java b/worldedit-core/src/main/java/com/boydti/fawe/object/visitor/DFSVisitor.java index 152e0ef4e..4d2d8861f 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/visitor/DFSVisitor.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/visitor/DFSVisitor.java @@ -104,7 +104,7 @@ public abstract class DFSVisitor implements Operation { from.getZ() + direction.getZ()); if (isVisitable(bv, bv2)) { Node adjacent = new Node(bv2.getBlockX(), bv2.getBlockY(), bv2.getBlockZ()); - if (!adjacent.equals(current.from)) { + if (current.from == null || !adjacent.equals(current.from)) { AtomicInteger adjacentCount = visited.get(adjacent); if (adjacentCount == null) { if (countAdd++ < maxBranch) {