From 79a41210982c92dfaf49ea5bb4602ef81398bc03 Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Thu, 4 Oct 2018 20:29:40 +1000 Subject: [PATCH] Return null if the material is null. --- .../com/sk89q/worldedit/bukkit/BukkitBlockRegistry.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitBlockRegistry.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitBlockRegistry.java index 88e4784d4..31db0f83d 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitBlockRegistry.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitBlockRegistry.java @@ -38,8 +38,11 @@ public class BukkitBlockRegistry extends BundledBlockRegistry { @Nullable @Override public BlockMaterial getMaterial(BlockType blockType) { - return materialMap.computeIfAbsent(BukkitAdapter.adapt(blockType), - material -> new BukkitBlockMaterial(BukkitBlockRegistry.super.getMaterial(blockType), material)); + Material mat = BukkitAdapter.adapt(blockType); + if (mat == null) { + return null; + } + return materialMap.computeIfAbsent(mat, material -> new BukkitBlockMaterial(BukkitBlockRegistry.super.getMaterial(blockType), material)); } @Nullable