Skip to content

Commit f003a89

Browse files
Fix a null reference exception with extensible template deployment (Azure#19783)
* Add symbolic name test * Add extensibility test, fix null ref bug * Add changelog entry * Update ChangeLog.md Co-authored-by: Yabo Hu <[email protected]>
1 parent 2fb0fcc commit f003a89

File tree

9 files changed

+456304
-1
lines changed

9 files changed

+456304
-1
lines changed

src/Resources/ResourceManager/SdkClient/ResourceManagerSdkClient.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ private List<DeploymentOperation> GetNewOperations(List<DeploymentOperation> old
355355
}
356356

357357
//If nested deployment, get the operations under those deployments as well
358-
if (operation.Properties.TargetResource != null && operation.Properties.TargetResource.ResourceType.Equals(Constants.MicrosoftResourcesDeploymentType, StringComparison.OrdinalIgnoreCase))
358+
if (operation.Properties.TargetResource?.ResourceType?.Equals(Constants.MicrosoftResourcesDeploymentType, StringComparison.OrdinalIgnoreCase) == true)
359359
{
360360
HttpStatusCode statusCode;
361361
Enum.TryParse<HttpStatusCode>(operation.Properties.StatusCode, out statusCode);

src/Resources/Resources.Test/ScenarioTests/DeploymentTests.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,5 +230,19 @@ public void TestNewDeploymentFromTemplateAndParameterFileContainingTagsOutput()
230230
{
231231
TestRunner.RunTestScript("Test-NewDeploymentFromTemplateAndParameterFileContainingTagsOutput");
232232
}
233+
234+
[Fact]
235+
[Trait(Category.AcceptanceType, Category.CheckIn)]
236+
public void TestSymbolicNameDeployment()
237+
{
238+
TestRunner.RunTestScript("Test-SymbolicNameDeployment");
239+
}
240+
241+
[Fact]
242+
[Trait(Category.AcceptanceType, Category.CheckIn)]
243+
public void TestExtensibleResourceDeployment()
244+
{
245+
TestRunner.RunTestScript("Test-ExtensibleResourceDeployment");
246+
}
233247
}
234248
}

0 commit comments

Comments
 (0)