Skip to content

Commit

Permalink
Merge pull request #9217 from drewnoakes/fix-1847450-avoid-nfe-from-m…
Browse files Browse the repository at this point in the history
…odified-rule-properties

Avoid NFE when ConfigurationGeneral rule is modified to remove expected property
  • Loading branch information
drewnoakes authored Aug 9, 2023
2 parents 5eb804f + 983b450 commit 73c887e
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -678,12 +678,11 @@ ProjectCopyData UpdateCopyData()
jointRuleUpdate.ProjectChanges.TryGetValue(ResolvedProjectReference.SchemaName, out IProjectChangeDescription? change2) &&
jointRuleUpdate.ProjectChanges.TryGetValue(ConfigurationGeneral.SchemaName, out IProjectChangeDescription? change3))
{
if (change1.Difference.AnyChanges || change2.Difference.AnyChanges || change3.Difference.AnyChanges)
if ((change1.Difference.AnyChanges || change2.Difference.AnyChanges || change3.Difference.AnyChanges) &&
change3.After.Properties.TryGetStringProperty(ConfigurationGeneral.TargetPathProperty, out string? targetPath))
{
// Register this project's data with the CopyToOutputDirectoryItem tracking service.

string targetPath = jointRuleUpdate.CurrentState[ConfigurationGeneral.SchemaName].Properties[ConfigurationGeneral.TargetPathProperty];

projectFileClassifier ??= BuildClassifier();

ImmutableArray<CopyItem> copyItems = change1.After.Items
Expand Down

0 comments on commit 73c887e

Please sign in to comment.