Replace most T.Parse with T.TryParse for all user input.

This commit is contained in:
hondacrx
2017-11-05 15:21:29 -05:00
parent 8c863de8a6
commit 8ed446ae7a
40 changed files with 477 additions and 527 deletions
@@ -74,15 +74,8 @@ namespace Game.Chat.Commands
handler.SendSysMessage(CypherStrings.NoCharSelected);
return false;
}
string timeStr = args.NextString();
if (string.IsNullOrEmpty(timeStr))
{
handler.SendSysMessage(CypherStrings.BadValue);
return false;
}
uint time = uint.Parse(timeStr);
if (time == 0)
if (!uint.TryParse(args.NextString(), out uint time) || time == 0)
{
handler.SendSysMessage(CypherStrings.BadValue);
return false;