Updated null checks in MetadataStoreBase. Fixes BUKKIT-1412
Previously, the method could be called with a null MetadataStore and stored. In later execution null pointer exceptions would be generated when checking for the plugin that the set Metadata belongs to. Additionally, places where a plugin is referenced will now throw an IllegalArgumentException if specified plugin is null. Using null would be an obvious logical flaw, and in some cases produce additional exceptions later in execution. By: mbax <github@phozop.net>
This commit is contained in:
@@ -62,7 +62,7 @@ public interface MetadataValue {
|
||||
/**
|
||||
* Returns the {@link Plugin} that created this metadata item.
|
||||
*
|
||||
* @return the plugin that owns this metadata value.
|
||||
* @return the plugin that owns this metadata value. This should never be null.
|
||||
*/
|
||||
public Plugin getOwningPlugin();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user