oyq28 8 月之前
父节点
当前提交
f7f811101c
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      opcua/Form_Main.cs

+ 1 - 1
opcua/Form_Main.cs

@@ -582,7 +582,7 @@ namespace IMCS
                             // 删除map中对应的bean
                             opcServerMap.Remove(opcBody.ServerUrl);
                             // 断开连接
-                            if (opcServer.Session != null)
+                            if (opcServer!=null && opcServer.Session != null)
                             {
                                 opcServer.Disconnect();
                             }