Skip to content

Commit

Permalink
Check status recorder for nil
Browse files Browse the repository at this point in the history
  • Loading branch information
lixmal committed Jan 22, 2025
1 parent b50daa0 commit c7e9566
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions client/internal/dns/upstream.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,10 @@ func (u *upstreamResolverBase) checkUpstreamFails(err error) {

u.disable(err)

if u.statusRecorder == nil {
return
}

u.statusRecorder.PublishEvent(
proto.SystemEvent_WARNING,
proto.SystemEvent_DNS,
Expand Down Expand Up @@ -229,6 +233,10 @@ func (u *upstreamResolverBase) probeAvailability() {
if !success {
u.disable(errors.ErrorOrNil())

if u.statusRecorder == nil {
return
}

u.statusRecorder.PublishEvent(
proto.SystemEvent_WARNING,
proto.SystemEvent_DNS,
Expand Down
2 changes: 1 addition & 1 deletion client/server/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,8 @@ func (s *Server) DeselectNetworks(_ context.Context, req *proto.SelectNetworksRe
"",
map[string]string{
"networks": strings.Join(req.GetNetworkIDs(), ", "),
"all": fmt.Sprint(req.GetAll()),
"append": fmt.Sprint(req.GetAppend()),
"all": fmt.Sprint(req.GetAll()),
},
)

Expand Down

0 comments on commit c7e9566

Please sign in to comment.