[Bleeding] Added missing NPE protection to removeMetadata(). Fixes BUKKIT-933

By: rmichela <deltahat@gmail.com>
This commit is contained in:
Bukkit/Spigot 2012-03-05 22:33:22 -05:00
parent 9bca84ee5b
commit 99569c1767

View file

@ -82,6 +82,7 @@ public abstract class MetadataStoreBase<T> {
public synchronized void removeMetadata(T subject, String metadataKey, Plugin owningPlugin) {
String key = cachedDisambiguate(subject, metadataKey);
List<MetadataValue> 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);