Skip to content

Commit

Permalink
Error in TfsWorkItemConvertor and Null reference in WorkItemMigration…
Browse files Browse the repository at this point in the history
…Context (#2231)

🐛 (TfsWorkItemConvertor.cs): fix logging issue by removing exception
parameter from Log.Warning

The exception parameter `e` is removed from the `Log.Warning` call
because it is not used in the log message. This change ensures that the
log message correctly reflects the intended warning without unnecessary
information.
  • Loading branch information
MrHinsh authored Aug 1, 2024
2 parents e6daec8 + 95de5a6 commit 08f4211
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ private SortedDictionary<int, RevisionItem> GetRevisionItems(RevisionCollection
}
catch (ArgumentException e)
{
Log.Warning(e, "For some Reason there are multiple Revisions on {WorkItemId} with the same System.Rev. We will create a renumbered list...", items[0].WorkItemId);
Log.Warning("For some Reason there are multiple Revisions on {WorkItemId} with the same System.Rev. We will create a renumbered list...", items[0].WorkItemId);
var currentNumber = -1;
foreach (var item in items)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -910,7 +910,7 @@ private WorkItemData ReplayRevisions(List<RevisionItem> revisionsToMigrate, Work
if (targetWorkItem != null)
{
foreach (Field f in targetWorkItem.ToWorkItem().Fields)
parameters.Add($"{f.ReferenceName} ({f.Name})", f.Value.ToString());
parameters.Add($"{f.ReferenceName} ({f.Name})", f.Value?.ToString());
}
_telemetry.TrackException(ex, parameters);
TraceWriteLine(LogEventLevel.Information, "...FAILED to Save");
Expand Down

0 comments on commit 08f4211

Please sign in to comment.