From 8026d6dbf1a006965d3a77dc9ebfc6dce21f054f Mon Sep 17 00:00:00 2001 From: forkfury Date: Tue, 9 Dec 2025 19:38:40 +0100 Subject: [PATCH] Update multisub.go --- event/multisub.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/event/multisub.go b/event/multisub.go index 1f0af2a292..aa01ea4ec1 100644 --- a/event/multisub.go +++ b/event/multisub.go @@ -19,6 +19,13 @@ package event // JoinSubscriptions joins multiple subscriptions to be able to track them as // one entity and collectively cancel them or consume any errors from them. func JoinSubscriptions(subs ...Subscription) Subscription { + // Handle empty subscription list to avoid blocking forever + if len(subs) == 0 { + return NewSubscription(func(unsubbed <-chan struct{}) error { + <-unsubbed + return nil + }) + } return NewSubscription(func(unsubbed <-chan struct{}) error { // Unsubscribe all subscriptions before returning defer func() {