mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
Entitycmd: Added try-catch statement around the Enum.Parse instruction
This commit is contained in:
parent
3d2b9b22a3
commit
30861a92ee
1 changed files with 10 additions and 1 deletions
|
|
@ -126,7 +126,16 @@ namespace MinecraftClient.Commands
|
|||
}
|
||||
catch (FormatException)
|
||||
{
|
||||
EntityType interacttype = Enum.Parse<EntityType>(args[0]);
|
||||
EntityType interacttype;
|
||||
try
|
||||
{
|
||||
interacttype = Enum.Parse<EntityType>(args[0]);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return Translations.cmd_entityCmd_not_found;
|
||||
}
|
||||
|
||||
string action = args.Length > 1
|
||||
? args[1].ToLower()
|
||||
: "list";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue