Commit ff3e2be2 authored by 潘栩锋's avatar 潘栩锋 🚴

修复 warningService.ReasonList 可以为null, 直接读取它会出错

parent 2c1358f2
...@@ -63,6 +63,19 @@ namespace FLY.Thick.Base.UI.OnInit ...@@ -63,6 +63,19 @@ namespace FLY.Thick.Base.UI.OnInit
List<int> errCodes = new List<int> { ERRNOs.Instance.SCAN_ERRNO_OVERCTRL.Code, ERRNOs.Instance.SCAN_ERRNO_OVERTOL.Code }; List<int> errCodes = new List<int> { ERRNOs.Instance.SCAN_ERRNO_OVERCTRL.Code, ERRNOs.Instance.SCAN_ERRNO_OVERTOL.Code };
var record = warningService.ReasonList; var record = warningService.ReasonList;
if (record == null)
{
//什么报警都没有
//不需要提示
if (warningTipId != -1)
{
//需要把之前的报警关闭
FLY.ControlLibrary.Window_WarningTip.Stop(warningTipId);
warningTipId = -1;
}
return;
}
var rs = from r in record where errCodes.Contains(r.ErrCode) select r; var rs = from r in record where errCodes.Contains(r.ErrCode) select r;
if (rs.Count() == 0) if (rs.Count() == 0)
{ {
...@@ -73,9 +86,9 @@ namespace FLY.Thick.Base.UI.OnInit ...@@ -73,9 +86,9 @@ namespace FLY.Thick.Base.UI.OnInit
FLY.ControlLibrary.Window_WarningTip.Stop(warningTipId); FLY.ControlLibrary.Window_WarningTip.Stop(warningTipId);
warningTipId = -1; warningTipId = -1;
} }
return;
} }
else
{
int errcode = rs.First().ErrCode; int errcode = rs.First().ErrCode;
string msg = rs.First().Description; string msg = rs.First().Description;
...@@ -90,7 +103,7 @@ namespace FLY.Thick.Base.UI.OnInit ...@@ -90,7 +103,7 @@ namespace FLY.Thick.Base.UI.OnInit
path, path,
warningService.Reset warningService.Reset
); );
}
}), this, MARKNO_WARNING_RING); }), this, MARKNO_WARNING_RING);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment