From a13a01f99f19bdfb6fc75e365e630c3eb5fd5bbe Mon Sep 17 00:00:00 2001 From: tiger_zhou Date: Thu, 18 Apr 2024 11:18:26 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=97=E8=BD=A6pc=E4=BB=BF=E7=9C=9F=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- third_party/tcp/tcp_client.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/third_party/tcp/tcp_client.go b/third_party/tcp/tcp_client.go index 2402db1..55a92d9 100644 --- a/third_party/tcp/tcp_client.go +++ b/third_party/tcp/tcp_client.go @@ -58,7 +58,8 @@ func (c *TcpClient) Close() { } } func (c *TcpClient) Send(data []byte) error { - if c.conn == nil { + + if c == nil || c.conn == nil { slog.Error("tcp client send error,conn is nil") return fmt.Errorf("TCP未连接车载PC仿真") }