Skip to content
This repository has been archived by the owner on Mar 8, 2022. It is now read-only.

Commit

Permalink
fix NullPointerException #4
Browse files Browse the repository at this point in the history
  • Loading branch information
cyilin committed Aug 17, 2016
1 parent 7ca98e5 commit 16f9224
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
7 changes: 3 additions & 4 deletions src/main/java/cat/nyaa/nyaautils/CommandHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,9 @@ public void commandEnchant(CommandSender sender, Arguments args) {
msg.append(" " + I18n._("user.enchant.max_level", plugin.cfg.enchantMaxLevel.get(e)));
p.spigot().sendMessage(msg.inner);
} else {
// FIXME
// if (e.getName().equalsIgnoreCase("Custom Enchantment")) {
// continue;
// }
if (e == null || e.getName() == null || e.getName().equalsIgnoreCase("Custom Enchantment")) {
continue;
}
p.sendMessage(e.getName() + ": " + e.getName() + " " +
I18n._("user.enchant.max_level", plugin.cfg.enchantMaxLevel.get(e)));
}
Expand Down
7 changes: 3 additions & 4 deletions src/main/java/cat/nyaa/nyaautils/Configuration.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,9 @@ public void deserialize(ConfigurationSection config) {
if (config.isConfigurationSection("enchant")) {
ConfigurationSection list = config.getConfigurationSection("enchant");
for (Enchantment e : Enchantment.values()) {
// FIXME
// if (e.getName().equalsIgnoreCase("Custom Enchantment")) {
// continue;
// }
if (e == null || e.getName() == null || e.getName().equalsIgnoreCase("Custom Enchantment")) {
continue;
}
enchantMaxLevel.put(e, list.getInt(e.getName() + ".MaxLevel", e.getMaxLevel()));
}
}
Expand Down

0 comments on commit 16f9224

Please sign in to comment.