From 30e9d91b57d9b752fff581791bd28c8361ac072c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=95=8C?= Date: Tue, 26 Nov 2024 12:00:56 +0800 Subject: [PATCH] Fix AppendClose --- common/network/conn.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/common/network/conn.go b/common/network/conn.go index c289bf61..ab3961f1 100644 --- a/common/network/conn.go +++ b/common/network/conn.go @@ -74,9 +74,10 @@ type ExtendedConn interface { type CloseHandlerFunc = func(it error) func AppendClose(parent CloseHandlerFunc, onClose CloseHandlerFunc) CloseHandlerFunc { + if onClose == nil { + panic("nil onClose") + } if parent == nil { - return parent - } else if onClose == nil { return onClose } return func(it error) {