Skip to content

Commit

Permalink
Deploy: fixed issue that throws an exception when GetOtherEnvironment…
Browse files Browse the repository at this point in the history
…sToTerminate returns an empty result set (#26)

* Terminate Environment Other Versions: fixed issue that throws an exception when GetOtherEnvironmentsToTerminate returns an empty result set

* Version bump
  • Loading branch information
almeidev authored Jan 24, 2022
1 parent a44322a commit fce76d1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
17 changes: 10 additions & 7 deletions src/Common/Services/NewEnvironmentUtilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -134,14 +134,17 @@ public async Task<CustomerEnvironmentCollection> GetOtherVersionToTerminate(Cust
DataSet dataSet = await _customerPortalClient.ExecuteQuery(query);

var result = new CustomerEnvironmentCollection();
foreach (DataRow row in dataSet?.Tables?[0]?.Rows)
if (dataSet?.Tables?.Count > 0)
{
result.Add(new CustomerEnvironment
{
Id = (long)row["Id"],
Name = (string)row["Name"],
DefinitionId = (long)row["DefinitionId"]
});
foreach (DataRow row in dataSet.Tables[0].Rows)
{
result.Add(new CustomerEnvironment
{
Id = (long)row["Id"],
Name = (string)row["Name"],
DefinitionId = (long)row["DefinitionId"]
});
}
}

return result;
Expand Down
2 changes: 1 addition & 1 deletion src/Version.props
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<Project>
<PropertyGroup>
<Version>1.3.0</Version>
<Version>1.3.1</Version>
</PropertyGroup>
</Project>

0 comments on commit fce76d1

Please sign in to comment.