Piotr Czajkowski 5 months ago
parent
commit
09281cffc3
1 changed files with 2 additions and 2 deletions
  1. 2 2
      ExcelORM/ExcelORM/ExcelReader.cs

+ 2 - 2
ExcelORM/ExcelORM/ExcelReader.cs

@@ -34,9 +34,9 @@ public class ExcelReader
                 var property = type.GetProperty(item.PropertyName);
                 if (property == null) continue;
 
-                if (property.PropertyType.BaseType != null && property.PropertyType.BaseType == typeof(SpecialBase))
+                if (property.PropertyType.BaseType == typeof(SpecialBase) &&
+                    RuntimeHelpers.GetUninitializedObject(property.PropertyType) is SpecialBase special)
                 {
-                    if (RuntimeHelpers.GetUninitializedObject(property.PropertyType) is not SpecialBase special) continue;
                     special.GetValueFromCell(cell);
 
                     property.SetValue(current, special);