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
+9 -6
View File
@@ -236,18 +236,21 @@ namespace Game.Chat.Commands
{
if (string.IsNullOrEmpty(param3))
{
if (!string.IsNullOrEmpty(param2))
realmId = int.Parse(param2);
if (!int.TryParse(param2, out realmId))
return null;
if (!string.IsNullOrEmpty(param1))
id = uint.Parse(param1);
if (!uint.TryParse(param1, out id))
return null;
useSelectedPlayer = true;
}
else
{
id = uint.Parse(param2);
realmId = int.Parse(param3);
if (!uint.TryParse(param2, out id))
return null;
if (!int.TryParse(param3, out realmId))
return null;
}
if (id == 0)