From f4833b0d7957ad3d2ec5317e36eca8e7b99e19e9 Mon Sep 17 00:00:00 2001 From: Andrey Kolchanov Date: Fri, 28 Oct 2022 16:44:24 +0500 Subject: [PATCH] fix: Fix null reference exception in the RegisterOrganization mutation --- .../Commands/RegisterRequestCommandHandler.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/VirtoCommerce.ProfileExperienceApiModule.Data/Commands/RegisterRequestCommandHandler.cs b/src/VirtoCommerce.ProfileExperienceApiModule.Data/Commands/RegisterRequestCommandHandler.cs index 8cf898a3..0d6d9d84 100644 --- a/src/VirtoCommerce.ProfileExperienceApiModule.Data/Commands/RegisterRequestCommandHandler.cs +++ b/src/VirtoCommerce.ProfileExperienceApiModule.Data/Commands/RegisterRequestCommandHandler.cs @@ -104,7 +104,7 @@ private async Task ProcessRequestAsync(RegisterReque _organizationValidator.ValidateAsync(organization) }; - foreach (var address in organization.Addresses) + foreach (var address in organization?.Addresses ?? new List
()) { validationTasks.Add(_addressValidator.ValidateAsync(address)); }