Skip to content

Commit

Permalink
修复闪退
Browse files Browse the repository at this point in the history
  • Loading branch information
mujianwu committed Jan 12, 2025
1 parent 72633b2 commit 71d7324
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions UotanToolbox/Common/StringHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,20 @@ public static string[] COMDevices(string COMInfo)

public static string GetProductID(string info)
{
if (info.IndexOf("FAILED") == -1)
try
{
string[] infos = info.Split(separator, StringSplitOptions.RemoveEmptyEntries);
string[] product = infos[0].Split(' ', StringSplitOptions.RemoveEmptyEntries);
return product[1];
if (info.IndexOf("FAILED") == -1)
{
string[] infos = info.Split(separator, StringSplitOptions.RemoveEmptyEntries);
string[] product = infos[0].Split(' ', StringSplitOptions.RemoveEmptyEntries);
return product[1];
}
else
{
return "--";
}
}
else
catch
{
return "--";
}
Expand Down

0 comments on commit 71d7324

Please sign in to comment.