610262374@qq.com
2018-11-24 01:59:34 +08:00
parent 8ace90f9f2
commit 1b2ea363a9

View File

@@ -110,11 +110,14 @@ namespace SqlSugar
if (this.IsMasterSlaveSeparation) if (this.IsMasterSlaveSeparation)
{ {
foreach (var slaveConnection in this.SlaveConnections) if (this.SlaveConnections != null)
{ {
if (slaveConnection != null && slaveConnection.State == ConnectionState.Open) foreach (var slaveConnection in this.SlaveConnections)
{ {
slaveConnection.Dispose(); if (slaveConnection != null && slaveConnection.State == ConnectionState.Open)
{
slaveConnection.Dispose();
}
} }
} }
} }