mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-23 16:56:31 +01:00
Check null before grabbing metadata owning plugin. Fixes BUKKIT-4665
MetadataStoreBase throws a NullPointerException when passed a null value for setMetaData. The intended behavior is to throw an IllegalArgumentException. This commit changes the value's null check to occur before referencing the owning plugin of a value. By: AlphaBlend <whizkid3000@hotmail.com>
This commit is contained in:
parent
d8cfc3fa42
commit
121764ab61
1 changed files with 1 additions and 1 deletions
|
@ -25,8 +25,8 @@ public abstract class MetadataStoreBase<T> {
|
|||
* @throws IllegalArgumentException If value is null, or the owning plugin is null
|
||||
*/
|
||||
public synchronized void setMetadata(T subject, String metadataKey, MetadataValue newMetadataValue) {
|
||||
Plugin owningPlugin = newMetadataValue.getOwningPlugin();
|
||||
Validate.notNull(newMetadataValue, "Value cannot be null");
|
||||
Plugin owningPlugin = newMetadataValue.getOwningPlugin();
|
||||
Validate.notNull(owningPlugin, "Plugin cannot be null");
|
||||
String key = disambiguate(subject, metadataKey);
|
||||
Map<Plugin, MetadataValue> entry = metadataMap.get(key);
|
||||
|
|
Loading…
Add table
Reference in a new issue