Added null check and removed unused method from Fillr

By: VictorD <victor.danell@gmail.com>
This commit is contained in:
Bukkit/Spigot
2011-01-16 17:05:13 +01:00
parent a17e7470e8
commit 6000fee9fc
2 changed files with 10 additions and 7 deletions

View File

@@ -16,8 +16,16 @@ public class CommandParserYaml {
if (map != null) {
for(Entry<String, Map<String, Object>> entry : map.entrySet()) {
String description = entry.getValue().get("description").toString();
String usageText = entry.getValue().get("usage").toString();
Object d = entry.getValue().get("description");
Object u = entry.getValue().get("usage");
String description = "";
String usageText = "";
if (d != null)
description = d.toString();
if (u != null)
usageText = u.toString();
cmds.add(new Command(entry.getKey(), description, usageText, plugin));
}