Skip to content

Commit 88a7820

Browse files
authored
Add null check in ConditionVersion of Set-AzRoleAssignmenr (#12829)
* add missing null check * update docs * Remove old TODO
1 parent 00bc26d commit 88a7820

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/Resources/Resources/ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
- Additional information about change #1
1919
-->
2020
## Upcoming Release
21+
* Added missing check for Set-AzRoleAssignment
2122
* Added breaking change attribute to `SubscriptionId` parameter of `Get-AzResourceGroupDeploymentOperation`
2223
* Updated ARM template What-If cmdlets to show "Ignore" resource changes last
2324
* Fixed secure and array parameter serialization issues for deployment cmdlets [#12773]

src/Resources/Resources/RoleAssignments/SetAzureRoleAssignmentCommand.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@ public override void ExecuteCmdlet()
112112
}
113113

114114
// If ConditionVersion is changed, validate it's in the allowed values
115-
var oldConditionVersion = double.Parse(InputObject.ConditionVersion);
116-
var newConditionVersion = double.Parse(fetchedRole.ConditionVersion);
115+
var oldConditionVersion = double.Parse(InputObject.ConditionVersion ?? "0.0");
116+
var newConditionVersion = double.Parse(fetchedRole.ConditionVersion ?? "2.0");
117117

118118
// A condition version can change but currently we don't support downgrading to 1.0
119119
// we only verify the change if it's a downgrade

0 commit comments

Comments
 (0)