From 0ffab8ee69061ee624ee7f6737067c5a49d4c555 Mon Sep 17 00:00:00 2001 From: dordsor21 Date: Tue, 17 Aug 2021 15:38:47 +0100 Subject: [PATCH] Add null check to preloader --- .../src/main/java/com/sk89q/worldedit/EditSession.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java b/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java index b7f5e31b3..91e215e44 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java @@ -49,6 +49,7 @@ import com.fastasyncworldedit.core.math.LocalBlockVectorSet; import com.fastasyncworldedit.core.math.MutableBlockVector2; import com.fastasyncworldedit.core.math.MutableBlockVector3; import com.fastasyncworldedit.core.object.FaweLimit; +import com.fastasyncworldedit.core.queue.implementation.preloader.Preloader; import com.fastasyncworldedit.core.regions.RegionWrapper; import com.fastasyncworldedit.core.util.EditSessionBuilder; import com.fastasyncworldedit.core.util.ExtentTraverser; @@ -1253,7 +1254,10 @@ public class EditSession extends PassthroughExtent implements AutoCloseable { } // Cancel any preloader associated with the actor if present if (getPlayer() != null) { - Fawe.imp().getPreloader(false).cancel(getPlayer()); + Preloader preloader = Fawe.imp().getPreloader(false); + if (preloader != null) { + preloader.cancel(getPlayer()); + } } // Enqueue it if (getChangeSet() != null) {