From 3dca57a706582557918deb86096e0b34dffce631 Mon Sep 17 00:00:00 2001 From: Malte E Date: Fri, 9 Aug 2024 07:57:50 +0200 Subject: [PATCH] check whether device == nil --- pkg/connector/groupinfo.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/connector/groupinfo.go b/pkg/connector/groupinfo.go index 43e2b78b..5c8b0004 100644 --- a/pkg/connector/groupinfo.go +++ b/pkg/connector/groupinfo.go @@ -124,7 +124,7 @@ func (s *SignalClient) getGroupInfo(ctx context.Context, groupID types.GroupIden var aci uuid.UUID if member.ServiceID.Type == libsignalgo.ServiceIDTypePNI { device, err := s.Client.Store.DeviceStore.DeviceByPNI(ctx, member.ServiceID.UUID) - if err != nil { + if err != nil || device == nil { continue } aci = device.ACI @@ -147,7 +147,7 @@ func (s *SignalClient) getGroupInfo(ctx context.Context, groupID types.GroupIden var aci uuid.UUID if member.ServiceID.Type == libsignalgo.ServiceIDTypePNI { device, err := s.Client.Store.DeviceStore.DeviceByPNI(ctx, member.ServiceID.UUID) - if err != nil { + if err != nil || device == nil { continue } aci = device.ACI @@ -264,7 +264,7 @@ func (s *SignalClient) groupChangeToChatInfoChange(ctx context.Context, rev uint var aci uuid.UUID if member.ServiceID.Type == libsignalgo.ServiceIDTypePNI { device, err := s.Client.Store.DeviceStore.DeviceByPNI(ctx, member.ServiceID.UUID) - if err != nil { + if err != nil || device == nil { continue } aci = device.ACI @@ -282,7 +282,7 @@ func (s *SignalClient) groupChangeToChatInfoChange(ctx context.Context, rev uint var aci uuid.UUID if memberServiceID.Type == libsignalgo.ServiceIDTypePNI { device, err := s.Client.Store.DeviceStore.DeviceByPNI(ctx, memberServiceID.UUID) - if err != nil { + if err != nil || device == nil { continue } aci = device.ACI @@ -312,7 +312,7 @@ func (s *SignalClient) groupChangeToChatInfoChange(ctx context.Context, rev uint var aci uuid.UUID if member.ServiceID.Type == libsignalgo.ServiceIDTypePNI { device, err := s.Client.Store.DeviceStore.DeviceByPNI(ctx, member.ServiceID.UUID) - if err != nil { + if err != nil || device == nil { continue } aci = device.ACI