Skip to content

Commit e84ecfe

Browse files
committed
Merge branch 'UpdateCmdlets3' into UpdateCmdlets4
2 parents b327f02 + 280e478 commit e84ecfe

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/ServiceManagement/RemoteApp/Commands.RemoteApp/Collection/GetAzureRemoteAppCollectionUsageDetails.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,19 @@ private void WriteUsageDetails(CollectionUsageDetailsResult detailsUsage)
9696
try
9797
{
9898
response = (HttpWebResponse)request.GetResponse();
99+
if (response == null)
100+
{
101+
ErrorRecord error = RemoteAppCollectionErrorState.CreateErrorRecordFromString(
102+
"Unable to retrieve Usage data", String.Empty, null, ErrorCategory.InvalidResult);
103+
WriteError(error);
104+
return;
105+
}
99106
}
100107
catch (Exception e)
101108
{
102109
ErrorRecord error = RemoteAppCollectionErrorState.CreateErrorRecordFromException(e, String.Empty, Client.Collections, ErrorCategory.InvalidResult);
103110
WriteError(error);
111+
return;
104112
}
105113

106114
using (Stream dataStream = response.GetResponseStream())

0 commit comments

Comments
 (0)