File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -89,7 +89,7 @@ private QuantityValue(decimal val)
89
89
public static explicit operator double ( QuantityValue number )
90
90
{
91
91
// double -> decimal -> zero (since we can't implement the default struct ctor)
92
- return number . _value . GetValueOrDefault ( ( double ) number . _valueDecimal . GetValueOrDefault ( ) ) ;
92
+ return number . _value ?? ( double ) number . _valueDecimal . GetValueOrDefault ( ) ;
93
93
}
94
94
95
95
#endregion
@@ -99,7 +99,7 @@ public static explicit operator double(QuantityValue number)
99
99
public static explicit operator decimal ( QuantityValue number )
100
100
{
101
101
// decimal -> double -> zero (since we can't implement the default struct ctor)
102
- return number . _valueDecimal . GetValueOrDefault ( ( decimal ) number . _value . GetValueOrDefault ( ) ) ;
102
+ return number . _valueDecimal ?? ( decimal ) number . _value . GetValueOrDefault ( ) ;
103
103
}
104
104
105
105
#endregion
You can’t perform that action at this time.
0 commit comments