Commit ed43b30d 刘韬

优化部分报错

1 个父辈 51e890e1
此文件类型无法预览
...@@ -214,7 +214,10 @@ namespace Asa.Camera ...@@ -214,7 +214,10 @@ namespace Asa.Camera
public void Close(string cameraName) public void Close(string cameraName)
{ {
for (int i = 0; i < cameraAll.Length; i++) for (int i = 0; i < cameraAll.Length; i++)
cameraAll[i].Close(cameraName); {
if (cameraAll[i].Count>0)
cameraAll[i].Close(cameraName);
}
Common.log.Info("Close Camera " + cameraName); Common.log.Info("Close Camera " + cameraName);
} }
......
...@@ -183,7 +183,8 @@ namespace Asa.HIK ...@@ -183,7 +183,8 @@ namespace Asa.HIK
public void Close(string cameraName) public void Close(string cameraName)
{ {
int idx = this.cameraName.FindIndex(s => s == cameraName); int idx = this.cameraName.FindIndex(s => s == cameraName);
CloseDevice(idx); if (idx>=0)
CloseDevice(idx);
} }
/// <summary> /// <summary>
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!