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.
This commit is contained in:
mbax
2012-07-16 15:05:51 -04:00
committed by Wesley Wolfe
parent 98d257daab
commit a2566bfc3e
4 changed files with 14 additions and 5 deletions

View File

@@ -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();