From 99569c1767cf18695ca2cc1e206bc74cf47d15cb Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Mon, 5 Mar 2012 22:33:22 -0500 Subject: [PATCH] [Bleeding] Added missing NPE protection to removeMetadata(). Fixes BUKKIT-933 By: rmichela --- .../src/main/java/org/bukkit/metadata/MetadataStoreBase.java | 1 + 1 file changed, 1 insertion(+) diff --git a/paper-api/src/main/java/org/bukkit/metadata/MetadataStoreBase.java b/paper-api/src/main/java/org/bukkit/metadata/MetadataStoreBase.java index 0c384abe89..a8d948a5ce 100644 --- a/paper-api/src/main/java/org/bukkit/metadata/MetadataStoreBase.java +++ b/paper-api/src/main/java/org/bukkit/metadata/MetadataStoreBase.java @@ -82,6 +82,7 @@ public abstract class MetadataStoreBase { public synchronized void removeMetadata(T subject, String metadataKey, Plugin owningPlugin) { String key = cachedDisambiguate(subject, metadataKey); List metadataList = metadataMap.get(key); + if (metadataList == null) return; for (int i = 0; i < metadataList.size(); i++) { if (metadataList.get(i).getOwningPlugin().equals(owningPlugin)) { metadataList.remove(i);