From 89b0421df83343ee133e8ef4f4d4a7ca251848a0 Mon Sep 17 00:00:00 2001 From: FelixTing Date: Mon, 9 Dec 2024 17:21:04 +0800 Subject: [PATCH] fix: Initialize DeviceService.Properties with an empty map Initialize DeviceService.Properties with an empty map to avoid unintended access to a nil map Signed-off-by: FelixTing --- pkg/service/service.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/service/service.go b/pkg/service/service.go index 9d1446f4..6793c522 100644 --- a/pkg/service/service.go +++ b/pkg/service/service.go @@ -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