]> git.maquefel.me Git - brevno-suite/hugo/commitdiff
warpc: Fix typed nil return in Start
authorShravani Totre <SHRAVANITOTRE8071@GMAIL.COM>
Sun, 18 Jan 2026 13:54:31 +0000 (19:24 +0530)
committerGitHub <noreply@github.com>
Sun, 18 Jan 2026 13:54:31 +0000 (14:54 +0100)
Fixes a panic in Close() when initialization fails by ensuring Start returns a nil interface instead of a typed nil.

See #14372

internal/warpc/warpc.go

index 03f4a6ed8befdb3c7aa32ddf03fef1f9d8bb675c..e62e6b09ea7fed7d2eb5d09e4dc31bc73385395f 100644 (file)
@@ -530,7 +530,11 @@ func Start[Q, R any](opts Options) (Dispatcher[Q, R], error) {
                opts.PoolSize = 1
        }
 
-       return newDispatcher[Q, R](opts)
+       d, err := newDispatcher[Q, R](opts)
+       if err != nil {
+               return nil, err
+       }
+       return d, nil
 }
 
 type dispatcherPool[Q, R any] struct {