From c33a838144810201553c47f3b1b6083e8e0d4b45 Mon Sep 17 00:00:00 2001 From: Federico Barresi Date: Fri, 5 Jun 2020 17:40:57 +0200 Subject: [PATCH] added null propagation on disconnect method --- Sharp7/S7Client.cs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Sharp7/S7Client.cs b/Sharp7/S7Client.cs index 9215011..45a26ae 100644 --- a/Sharp7/S7Client.cs +++ b/Sharp7/S7Client.cs @@ -724,10 +724,7 @@ namespace Sharp7 public int Disconnect() { - if (Socket != null && Socket.Connected) - { - Socket.Close(); - } + Socket?.Close(); return 0; }