From 1240c1670be02757d708e082db8cfa20c89e581c Mon Sep 17 00:00:00 2001 From: Denys Smirnov Date: Mon, 4 Dec 2023 17:21:21 +0200 Subject: [PATCH] SIP: Properly handle nil trunk. (#2291) --- pkg/service/ioservice_sip.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/service/ioservice_sip.go b/pkg/service/ioservice_sip.go index 076bff512..ba2286d8d 100644 --- a/pkg/service/ioservice_sip.go +++ b/pkg/service/ioservice_sip.go @@ -61,6 +61,9 @@ func (s *IOInfoService) GetSIPTrunkAuthentication(ctx context.Context, req *rpc. if err != nil { return nil, err } + if trunk == nil { + return &rpc.GetSIPTrunkAuthenticationResponse{}, nil + } return &rpc.GetSIPTrunkAuthenticationResponse{ Username: trunk.InboundUsername, Password: trunk.InboundPassword,