From 95532792f99bcdf3b0b6cd6fd44c8e421d4919cb Mon Sep 17 00:00:00 2001 From: qydysky Date: Wed, 8 Nov 2023 00:42:49 +0800 Subject: [PATCH] 1 --- ctx/Ctx.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ctx/Ctx.go b/ctx/Ctx.go index 476632d..64dc8d2 100644 --- a/ctx/Ctx.go +++ b/ctx/Ctx.go @@ -93,6 +93,9 @@ func WaitCtx(ctx context.Context) (dctx context.Context, done func()) { } func Done(ctx context.Context) bool { + if ctx == nil { + return false + } select { case <-ctx.Done(): return true -- 2.39.2