From ea353de21e0caffea7ce2634b715aab50eb6ddb3 Mon Sep 17 00:00:00 2001 From: "Martin Hinshelwood nkdAgility.com" Date: Tue, 19 Mar 2024 14:35:13 +0000 Subject: [PATCH] [preview] Fix for `GetUsersInSourceMappedToTargetForWorkItems` being null (#1991) --- .../Execution/MigrationContext/WorkItemMigrationContext.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/VstsSyncMigrator.Core/Execution/MigrationContext/WorkItemMigrationContext.cs b/src/VstsSyncMigrator.Core/Execution/MigrationContext/WorkItemMigrationContext.cs index a1b988954..9a778c936 100644 --- a/src/VstsSyncMigrator.Core/Execution/MigrationContext/WorkItemMigrationContext.cs +++ b/src/VstsSyncMigrator.Core/Execution/MigrationContext/WorkItemMigrationContext.cs @@ -274,7 +274,7 @@ private void ValidateAllUsersExistOrAreMapped(List sourceWorkItems contextLog.Information("Validating::Check that all users in the source exist in the target or are mapped!"); List usersToMap = new List(); usersToMap = _userMappingEnricher.GetUsersInSourceMappedToTargetForWorkItems(sourceWorkItems); - if (usersToMap.Count > 0) + if (usersToMap != null && usersToMap?.Count > 0) { Log.LogWarning("Validating Failed! There are {usersToMap} users that exist in the source that do not exist in the target. This will not cause any errors, but may result in disconnected users that could have been mapped. Use the ExportUsersForMapping processor to create a list of mappable users. Then Import using ", usersToMap.Count); }