Skip to content

Commit

Permalink
fix: Initialize DeviceService.Properties with an empty map
Browse files Browse the repository at this point in the history
Initialize DeviceService.Properties with an empty map to avoid unintended access to a nil map

Signed-off-by: FelixTing <felix@iotechsys.com>
  • Loading branch information
FelixTing committed Dec 9, 2024
1 parent 21de6ff commit 89b0421
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions pkg/service/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@ func (s *deviceService) selfRegister() edgexErr.EdgeX {
Labels: s.config.Device.Labels,
BaseAddress: bootstrapTypes.DefaultHttpProtocol + "://" + s.config.Service.Host + ":" + strconv.FormatInt(int64(s.config.Service.Port), 10),
AdminState: models.Unlocked,
Properties: make(map[string]any),
}
*s.deviceServiceModel = localDeviceService
ctx := context.WithValue(context.Background(), common.CorrelationHeader, uuid.NewString()) // nolint:staticcheck
Expand Down

0 comments on commit 89b0421

Please sign in to comment.