Scissors/patches/server/0047-Improve-validation-of-ResourceLocations.patch
Luna 65d7993679
Backport 1.20.1 patches to 1.19.4 (#116)
* First pass

* Second and final pass

* Update Jenkinsfile
2023-07-04 16:10:53 -05:00

19 lines
942 B
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Luna <lunahatesgogle@gmail.com>
Date: Tue, 13 Jun 2023 18:29:18 -0300
Subject: [PATCH] Improve validation of ResourceLocations
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftNamespacedKey.java b/src/main/java/org/bukkit/craftbukkit/util/CraftNamespacedKey.java
index 5014192edb9616ce725fc1592832034789527b6f..64da1b0afd51720803aba0d9e86d0b1743bdb0da 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftNamespacedKey.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftNamespacedKey.java
@@ -21,6 +21,7 @@ public final class CraftNamespacedKey {
}
public static NamespacedKey fromMinecraft(ResourceLocation minecraft) {
+ if (minecraft == null) throw new IllegalArgumentException("Null ResourceLocation provided"); // Scissors
return new NamespacedKey(minecraft.getNamespace(), minecraft.getPath());
}