Skip to content

Commit 12d9bc6

Browse files
author
Hovsep Mkrtchyan
committed
Fixed test failures
1 parent e033d12 commit 12d9bc6

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/CLU/Microsoft.Azure.Commands.Resources/Models.ResourceGroups/ResourceClient.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,9 @@ private Deployment CreateBasicDeployment(ValidatePSResourceGroupDeploymentParame
329329
}
330330
else
331331
{
332-
deployment.Properties.Template = JObject.Parse(DataStore.ReadFileAsText(parameters.TemplateFile));
332+
var textData = DataStore.ReadFileAsText(parameters.TemplateFile);
333+
deployment.Properties.Template = string.IsNullOrEmpty(textData) ?
334+
(object)textData : JObject.Parse(DataStore.ReadFileAsText(parameters.TemplateFile));
333335
}
334336

335337
if (Uri.IsWellFormedUriString(parameters.ParameterUri, UriKind.Absolute))
@@ -341,7 +343,9 @@ private Deployment CreateBasicDeployment(ValidatePSResourceGroupDeploymentParame
341343
}
342344
else
343345
{
344-
deployment.Properties.Parameters = JObject.Parse(GetDeploymentParameters(parameters.TemplateParameterObject));
346+
var deploymentParameters = GetDeploymentParameters(parameters.TemplateParameterObject);
347+
deployment.Properties.Parameters = string.IsNullOrEmpty(deploymentParameters) ?
348+
(object) deploymentParameters : JObject.Parse(deploymentParameters);
345349
}
346350

347351
return deployment;

0 commit comments

Comments
 (0)