Skip to content

Commit

Permalink
Added null check and removed unused method from Fillr
Browse files Browse the repository at this point in the history
  • Loading branch information
VictorD committed Jan 16, 2011
1 parent f8335d6 commit 558100c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
5 changes: 0 additions & 5 deletions src/main/java/org/bukkit/fillr/Fillr.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import org.bukkit.*;
import org.bukkit.plugin.*;
import org.bukkit.plugin.java.*;
import org.bukkit.entity.Player;
import org.bukkit.event.*;

import java.io.File;
Expand Down Expand Up @@ -31,8 +30,4 @@ private void registerEvents() {
listener = new FillrListener(getServer());
getServer().getPluginManager().registerEvent(Event.Type.PLAYER_COMMAND, listener, Event.Priority.Normal, this);
}

public void onCommand(Player player, String command, String[] args) {
// TODO Auto-generated method stub
}
}
12 changes: 10 additions & 2 deletions src/main/java/org/bukkit/plugin/CommandParserYaml.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,16 @@ public static List<Command> parse(Plugin plugin) {

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));
}
Expand Down

0 comments on commit 558100c

Please sign in to comment.