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

Commit a4ad193

Browse files
committed
fix null ref error
1 parent d082d08 commit a4ad193

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/APIM_ARMTemplate/apimtemplate/Extractor/EntityExtractors/BackendExtractor.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,9 @@ public bool DoesPolicyReferenceBackend(string policyContent, IEnumerable<Templat
8989
{
9090
// a policy is referenced by a backend with the set-backend-service policy, which will reference use the backends name or url, or through referencing a named value that applies to the backend
9191
var namedValueResourcesUsedByBackend = namedValueResources.Where(resource => DoesBackendReferenceNamedValue(resource, backendTemplateResource));
92-
if (policyContent.Contains(backendName) || policyContent.Contains(backendTemplateResource.properties.url) || policyContent.Contains(backendTemplateResource.properties.resourceId))
92+
if ((backendName != null && policyContent.Contains(backendName)) ||
93+
(backendTemplateResource.properties.url != null && policyContent.Contains(backendTemplateResource.properties.url)) ||
94+
(backendTemplateResource.properties.resourceId != null && policyContent.Contains(backendTemplateResource.properties.resourceId)))
9395
{
9496
return true;
9597
}

src/APIM_ARMTemplate/apimtemplate/Properties/launchSettings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"profiles": {
33
"apimtemplate": {
44
"commandName": "Project",
5-
"commandLineArgs": "extract --name apiphany --resourceGroup vlvinogr-apim --fileFolder C:\\\\\\\\Users\\\\\\\\lucashh\\\\\\\\Desktop\\\\\\\\Projects\\\\\\\\APIM-ARM\\\\\\\\ExtractedTemplates\\\\Full"
5+
"commandLineArgs": "extract --name LucasBlankLinked --resourceGroup LucasHuetHudsonInternal --fileFolder C:\\\\\\\\Users\\\\\\\\lucashh\\\\\\\\Desktop\\\\\\\\Projects\\\\\\\\APIM-ARM\\\\\\\\ExtractedTemplates\\\\SingleAPI --apiName firstAPI"
66
}
77
}
88
}

0 commit comments

Comments
 (0)