Skip to content

Commit 636b366

Browse files
authored
Merge pull request #342 from darshanhs90/adappfix
fix null ptr issue with the commandlet
2 parents 01645cf + d7b780b commit 636b366

File tree

3 files changed

+229
-144
lines changed

3 files changed

+229
-144
lines changed

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

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -462,11 +462,14 @@ function Test-NewADApplication
462462

463463
# Assert
464464
Assert-NotNull $application
465-
466-
# Get Application by ObjectId
467-
$app1 = Get-AzureRmADApplication -ObjectId $application.ObjectId
468-
Assert-NotNull $app1
469-
Assert-AreEqual $app1.Count 1
465+
$apps = Get-AzureRmADApplication
466+
Assert-NotNull $apps
467+
Assert-True { $apps.Count -ge 0 }
468+
469+
# Get Application by ObjectId
470+
$app1 = Get-AzureRmADApplication -ObjectId $application.ObjectId
471+
Assert-NotNull $app1
472+
Assert-AreEqual $app1.Count 1
470473

471474
# Get Application by ApplicationId
472475
$app1 = Get-AzureRmADApplication -ApplicationId $application.ApplicationId

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)