Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check null before grabbing owning plugin - fixes BUKKIT-3987 #843

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main/java/org/bukkit/metadata/MetadataStoreBase.java
Expand Up @@ -25,8 +25,8 @@ public abstract class MetadataStoreBase<T> {
* @throws IllegalArgumentException If value is null, or the owning plugin is null * @throws IllegalArgumentException If value is null, or the owning plugin is null
*/ */
public synchronized void setMetadata(T subject, String metadataKey, MetadataValue newMetadataValue) { public synchronized void setMetadata(T subject, String metadataKey, MetadataValue newMetadataValue) {
Plugin owningPlugin = newMetadataValue.getOwningPlugin();
Validate.notNull(newMetadataValue, "Value cannot be null"); Validate.notNull(newMetadataValue, "Value cannot be null");
Plugin owningPlugin = newMetadataValue.getOwningPlugin();
Validate.notNull(owningPlugin, "Plugin cannot be null"); Validate.notNull(owningPlugin, "Plugin cannot be null");
String key = disambiguate(subject, metadataKey); String key = disambiguate(subject, metadataKey);
Map<Plugin, MetadataValue> entry = metadataMap.get(key); Map<Plugin, MetadataValue> entry = metadataMap.get(key);
Expand Down