判断int型异常

This commit is contained in:
Caiyanpeng committed 2021-09-17 09:35:15 +08:00
1 parent 40b6205abc
commit 65f2b0af0a
1 file changed
+1 -1
+1 -1
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;
}