mirror of
https://github.com/greenshot/greenshot
synced 2025-08-14 02:37:03 -07:00
Fixed optimize error.
This commit is contained in:
parent
610f45d082
commit
4ff0f090bb
1 changed files with 8 additions and 3 deletions
|
@ -140,8 +140,13 @@ namespace Greenshot.IniFile {
|
|||
public Type ValueType {
|
||||
get {
|
||||
var valueType = _propertyInfo?.PropertyType ?? _fieldInfo.FieldType;
|
||||
if (!valueType.IsGenericType)
|
||||
{
|
||||
return valueType;
|
||||
}
|
||||
var genericTypeDefinition = valueType.GetGenericTypeDefinition();
|
||||
if (genericTypeDefinition != null && (valueType.IsGenericType && genericTypeDefinition == typeof(Nullable<>))) {
|
||||
if (genericTypeDefinition != null && genericTypeDefinition == typeof(Nullable<>))
|
||||
{
|
||||
// We are dealing with a generic type that is nullable
|
||||
valueType = Nullable.GetUnderlyingType(valueType);
|
||||
}
|
||||
|
@ -286,8 +291,8 @@ namespace Greenshot.IniFile {
|
|||
return;
|
||||
}
|
||||
} else if (!string.IsNullOrEmpty(propertyValue)) {
|
||||
var genericTypeDefinition = valueType.GetGenericTypeDefinition();
|
||||
if (genericTypeDefinition != null && (valueType.IsGenericType && genericTypeDefinition == typeof(Nullable<>))) {
|
||||
if (valueType.IsGenericType && valueType.GetGenericTypeDefinition() == typeof(Nullable<>))
|
||||
{
|
||||
// We are dealing with a generic type that is nullable
|
||||
valueType = Nullable.GetUnderlyingType(valueType);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue