判断int型异常

This commit is contained in:
CaiYanPeng 2021-09-17 09:35:15 +08:00
parent 40b6205abc
commit 65f2b0af0a

View File

@ -84,7 +84,7 @@ namespace Assets.Scripts
{
//iPhone2,1
var s = info.Replace("iPhone", "").Split(',');
return s.Length == 2 && int.Parse(s[0]) < 9;
return s.Length == 2 && int.TryParse(s[0],out int gen) && gen < 9;
}
return false;
}