Skip to content

Commit 024a3f1

Browse files
committed
fix designed year being null ref
1 parent d73e7f7 commit 024a3f1

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

Gui/Views/ExtendedPropertyGrid.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,11 @@ public override bool HandlePropertyChanged(PropertyCellContext context)
117117
? (uint8_t)costIndexProperty.GetValue(target)!
118118
: (uint8_t)0;
119119

120-
var designedYearProperty = TypeDescriptor.GetProperties(target)[currencyAttr.DesignedYearPropertyName];
121-
var designedYear = designedYearProperty != null
120+
var designedYearProperty = currencyAttr.DesignedYearPropertyName is null
121+
? null
122+
: TypeDescriptor.GetProperties(target)[currencyAttr.DesignedYearPropertyName];
123+
124+
var designedYear = designedYearProperty is not null
122125
? (uint16_t)designedYearProperty.GetValue(target)!
123126
: (uint16_t)1950;
124127

0 commit comments

Comments
 (0)