Skip to content

Commit

Permalink
Merge pull request #9 from MabOneSdk/anudeeb
Browse files Browse the repository at this point in the history
Get-AzureBackupContainer bug fixes
  • Loading branch information
Samuel Anudeep committed Jun 10, 2015
2 parents 4d75282 + ed1c635 commit 1ccebbc
Showing 1 changed file with 7 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -189,18 +189,15 @@ public async Task<ListContainerResponse> ListAsync(string queryFilterString, Cus
responseDoc = JToken.Parse(responseContent);
}

JToken listContainerResponseValue = responseDoc["ListContainerResponse"];
if (listContainerResponseValue != null && listContainerResponseValue.Type != JTokenType.Null)
if (responseDoc != null && responseDoc.Type != JTokenType.Null)
{
ListContainerResponse listContainerResponseInstance = new ListContainerResponse();

JToken objectsArray = listContainerResponseValue["Objects"];
JToken objectsArray = responseDoc["Objects"];
if (objectsArray != null && objectsArray.Type != JTokenType.Null)
{
foreach (JToken objectsValue in ((JArray)objectsArray))
{
ContainerInfo containerInfoInstance = new ContainerInfo();
listContainerResponseInstance.Objects.Add(containerInfoInstance);
result.Objects.Add(containerInfoInstance);

JToken friendlyNameValue = objectsValue["FriendlyName"];
if (friendlyNameValue != null && friendlyNameValue.Type != JTokenType.Null)
Expand Down Expand Up @@ -281,18 +278,18 @@ public async Task<ListContainerResponse> ListAsync(string queryFilterString, Cus
}
}

JToken resultCountValue = listContainerResponseValue["ResultCount"];
JToken resultCountValue = responseDoc["ResultCount"];
if (resultCountValue != null && resultCountValue.Type != JTokenType.Null)
{
int resultCountInstance = ((int)resultCountValue);
listContainerResponseInstance.ResultCount = resultCountInstance;
result.ResultCount = resultCountInstance;
}

JToken skiptokenValue = listContainerResponseValue["Skiptoken"];
JToken skiptokenValue = responseDoc["Skiptoken"];
if (skiptokenValue != null && skiptokenValue.Type != JTokenType.Null)
{
string skiptokenInstance = ((string)skiptokenValue);
listContainerResponseInstance.Skiptoken = skiptokenInstance;
result.Skiptoken = skiptokenInstance;
}
}

Expand Down

0 comments on commit 1ccebbc

Please sign in to comment.