Skip to content

Commit fc440e8

Browse files
authored
Fix NPE when inbound close races with ack. (#373)
1 parent e91fbf5 commit fc440e8

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pkg/sip/outbound.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -836,6 +836,9 @@ func (c *sipOutbound) AckInviteOK(ctx context.Context) error {
836836
defer span.End()
837837
c.mu.Lock()
838838
defer c.mu.Unlock()
839+
if c.invite == nil || c.inviteOk == nil {
840+
return errors.New("call already closed")
841+
}
839842
return c.c.sipCli.WriteRequest(sip.NewAckRequest(c.invite, c.inviteOk, nil))
840843
}
841844

0 commit comments

Comments
 (0)