From 79b5880c909d4357194c7107e7c001f6eb857960 Mon Sep 17 00:00:00 2001 From: "Martin Hinshelwood nkdAgility.com" Date: Tue, 19 Mar 2024 13:46:13 +0000 Subject: [PATCH 1/2] Fix for null users list --- .../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..59c066ac9 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?.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); } From 88692ccc949fec2618ba48499326842da5f99c46 Mon Sep 17 00:00:00 2001 From: "Martin Hinshelwood nkdAgility.com" Date: Tue, 19 Mar 2024 14:08:03 +0000 Subject: [PATCH 2/2] Update fix --- .../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 59c066ac9..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); }