Skip to content

Commit

Permalink
Fix AppendClose
Browse files Browse the repository at this point in the history
  • Loading branch information
nekohasekai committed Nov 26, 2024
1 parent 7fd3517 commit 30e9d91
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions common/network/conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 30e9d91

Please sign in to comment.