Skip to content

Commit

Permalink
fix possible nil pointer deref
Browse files Browse the repository at this point in the history
  • Loading branch information
denniskniep committed May 26, 2024
1 parent ea64e52 commit 4f1c1e0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/clients/searchattribute.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,12 @@ func (s *TemporalServiceImpl) ListSearchAttributesByNamespace(ctx context.Contex
return nil, err
}

var customAttributes = make([]*core.SearchAttributeObservation, 0, len(response.CustomAttributes))

if response == nil {
return customAttributes, nil
return make([]*core.SearchAttributeObservation, 0), nil
}

var customAttributes = make([]*core.SearchAttributeObservation, 0, len(response.CustomAttributes))

for attrName, attrType := range response.CustomAttributes {
customAttribute := core.SearchAttributeObservation{
Name: attrName,
Expand Down

0 comments on commit 4f1c1e0

Please sign in to comment.