diff --git a/rpc/core/events.go b/rpc/core/events.go index 5e6b3db57f..f9f431e5c6 100644 --- a/rpc/core/events.go +++ b/rpc/core/events.go @@ -41,6 +41,9 @@ func Subscribe(ctx *rpctypes.Context, query string) (*ctypes.ResultSubscribe, er if err != nil { return nil, err } + if sub == nil { + return nil, fmt.Errorf("env.EventBus.Subscribe() returned nil") + } // Capture the current ID, since it can change in the future. subscriptionID := ctx.JSONReq.ID