Skip to content

Commit

Permalink
internal/jsonrpc2: fix jsonrpc result no pending[id] always waits for…
Browse files Browse the repository at this point in the history
… a response
  • Loading branch information
a-wing committed Sep 11, 2019
1 parent 16c5e0f commit 87b3d0a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions internal/jsonrpc2/jsonrpc2.go
Original file line number Diff line number Diff line change
Expand Up @@ -386,8 +386,10 @@ func (c *Conn) Run(runCtx context.Context) error {
Error: msg.Error,
ID: msg.ID,
}
rchan <- response
close(rchan)
if rchan != nil {
rchan <- response
close(rchan)
}
default:
for _, h := range c.handlers {
h.Error(runCtx, fmt.Errorf("message not a call, notify or response, ignoring"))
Expand Down

0 comments on commit 87b3d0a

Please sign in to comment.