Skip to content
This repository was archived by the owner on Feb 23, 2024. It is now read-only.

Commit 54918ce

Browse files
authored
Changed type check to protect against null values (#794)
1 parent 5282cbd commit 54918ce

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ArmTemplates/Extractor/Utilities/DataProcessors/ApiOperationDataProcessor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ void SanitizeExampleValues(ApiOperationRepresentation representation)
3636
foreach (var exampleValue in representation.Examples.Values)
3737
{
3838
// Documentation on escaping characters https://docs.microsoft.com/en-us/azure/azure-resource-manager/templates/template-expressions#escape-characters
39-
if (exampleValue.Value.GetType() == typeof(string) && exampleValue.Value.ToString().StartsWith("[") && exampleValue.Value.ToString().EndsWith("]"))
39+
if (exampleValue.Value is string && exampleValue.Value.ToString().StartsWith("[") && exampleValue.Value.ToString().EndsWith("]"))
4040
{
4141
exampleValue.Value = $"[{exampleValue.Value}";
4242
}

0 commit comments

Comments
 (0)