Fixed NPE in /list

This commit is contained in:
Jerome van der Sar 2013-12-01 11:55:50 +01:00
parent 0c4c36b2bd
commit acd8373f81
4 changed files with 9 additions and 8 deletions

View File

@ -1,3 +1,3 @@
#Build Number for ANT. Do not edit!
#Sat Nov 30 20:40:55 CET 2013
build.number=636
#Sun Dec 01 11:54:49 CET 2013
build.number=638

View File

@ -66,8 +66,8 @@ public class Command_list extends TFM_Command
if (userSuperadmin)
{
TFM_Superadmin entry = TFM_SuperadminList.getAdminEntry(player.getName());
if (!entry.isSeniorAdmin() && entry.isTelnetAdmin())
final TFM_Superadmin entry = TFM_SuperadminList.getAdminEntry(player.getName());
if (entry != null && !entry.isSeniorAdmin() && entry.isTelnetAdmin())
{
prefix = (ChatColor.DARK_GREEN + "[STA]");
}

View File

@ -160,13 +160,13 @@ public class TFM_SuperadminList
}
}
public static TFM_Superadmin getAdminEntry(String admin_name)
public static TFM_Superadmin getAdminEntry(String name)
{
admin_name = admin_name.toLowerCase();
name = name.toLowerCase();
if (superadminList.containsKey(admin_name))
if (superadminList.containsKey(name))
{
return superadminList.get(admin_name);
return superadminList.get(name);
}
else
{

View File

@ -241,6 +241,7 @@ public class TotalFreedomMod extends JavaPlugin
catch (Throwable ex)
{
TFM_Log.severe("Command Error: " + commandLabel + "\n" + ExceptionUtils.getStackTrace(ex));
sender.sendMessage(ChatColor.RED + "Command Error: " + ex.getMessage());
}
}