浏览代码

Fixed ArrayIndexOutOfBounds with mmoedit

nossr50 13 年之前
父节点
当前提交
577badf4d8
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      src/main/java/com/gmail/nossr50/commands/general/MmoeditCommand.java

+ 2 - 2
src/main/java/com/gmail/nossr50/commands/general/MmoeditCommand.java

@@ -33,8 +33,6 @@ public class MmoeditCommand implements CommandExecutor {
 			sender.sendMessage("This command requires permissions.");
 			return true;
 		}
-        
-        PlayerProfile PPt = Users.getOfflineProfile(args[0]);
 
 		if (!(sender instanceof Player)) 
 		{
@@ -44,6 +42,7 @@ public class MmoeditCommand implements CommandExecutor {
 				return true;
 			} else if (args.length == 3)
 			{
+			    PlayerProfile PPt = Users.getOfflineProfile(args[0]);
 			    if(!PPt.isLoaded())
 		        {
 		            sender.sendMessage("Player does not exist in the database!");
@@ -77,6 +76,7 @@ public class MmoeditCommand implements CommandExecutor {
 		}
 		if (args.length == 3) 
 		{
+		    PlayerProfile PPt = Users.getOfflineProfile(args[0]);
 		    if(!PPt.isLoaded())
 	        {
 	            sender.sendMessage("Player does not exist in the database!");