From 24c8c2a80e0ffdbdbeee669306eafe549ed34891 Mon Sep 17 00:00:00 2001 From: Nicholas Molnar <65710+neekolas@users.noreply.github.com> Date: Tue, 24 Oct 2023 09:42:21 -0700 Subject: [PATCH] Fix problem with mocks --- pkg/api/message/v3/service_test.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkg/api/message/v3/service_test.go b/pkg/api/message/v3/service_test.go index 10da71da..9bc9bef0 100644 --- a/pkg/api/message/v3/service_test.go +++ b/pkg/api/message/v3/service_test.go @@ -25,7 +25,12 @@ type mockedMlsValidationService struct { func (m *mockedMlsValidationService) ValidateKeyPackages(ctx context.Context, keyPackages [][]byte) ([]mlsvalidate.IdentityValidationResult, error) { args := m.Called(ctx, keyPackages) - return args.Get(0).([]mlsvalidate.IdentityValidationResult), args.Error(1) + response := args.Get(0) + if response == nil { + return nil, args.Error(1) + } + + return response.([]mlsvalidate.IdentityValidationResult), args.Error(1) } func (m *mockedMlsValidationService) ValidateGroupMessages(ctx context.Context, groupMessages [][]byte) ([]mlsvalidate.GroupMessageValidationResult, error) {