Skip to content

Commit 3adcbca

Browse files
committed
fix null ptr issue with the commandlet
1 parent 69e474b commit 3adcbca

File tree

3 files changed

+225
-139
lines changed

3 files changed

+225
-139
lines changed

src/ResourceManager/Resources/Commands.Resources.Test/ScenarioTests/ActiveDirectoryTests.ps1

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -463,6 +463,10 @@ function Test-NewADApplication
463463
# Assert
464464
Assert-NotNull $application
465465

466+
$apps = Get-AzureRmADApplication
467+
Assert-NotNull $apps
468+
Assert-True { $apps.Count -ge 0 }
469+
466470
# Get Application by ObjectId
467471
$app1 = Get-AzureRmADApplication -ObjectId $application.ObjectId
468472
Assert-NotNull $app1

src/ResourceManager/Resources/Commands.Resources.Test/SessionRecords/Microsoft.Azure.Commands.Resources.Test.ScenarioTests.ActiveDirectoryTests/TestNewADApplication.json

Lines changed: 220 additions & 138 deletions
Large diffs are not rendered by default.

src/ResourceManager/Resources/Commands.Resources/ActiveDirectory/GetAzureADApplicationCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public override void ExecuteCmdlet()
5353
}
5454
else
5555
{
56-
Rest.Azure.OData.ODataQuery<Application> odataQueryFilter = null;
56+
Rest.Azure.OData.ODataQuery<Application> odataQueryFilter = new Rest.Azure.OData.ODataQuery<Application>();
5757

5858
if (ApplicationId != Guid.Empty)
5959
{

0 commit comments

Comments
 (0)