fix: ensure return a nil interface not an interface with nil value

This commit is contained in:
wwqgtxx 2023-02-18 14:16:03 +08:00
parent cc3a9dd553
commit b9e63d3f7d

View file

@ -306,6 +306,9 @@ func (wsedc *websocketWithEarlyDataConn) LazyHeadroom() bool {
}
func (wsedc *websocketWithEarlyDataConn) Upstream() any {
if wsedc.Conn == nil { // ensure return a nil interface not an interface with nil value
return nil
}
return wsedc.Conn
}