Skip to content

Commit 53cdcfc

Browse files
committed
Added a fallback for specialized getter/setter
1 parent 6039823 commit 53cdcfc

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/NHibernate/Bytecode/Lightweight/ReflectionOptimizer.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,13 @@ public ReflectionOptimizer(System.Type mappedType, IGetter[] getters, ISetter[]
7373
setInvoker,
7474
getMethods,
7575
setMethods,
76-
GenerateGetPropertyValueMethod(specializedGetter),
77-
GenerateSetPropertyValueMethod(specializedSetter)
76+
// 6.0 TODO: Remove ternary ifs once the obsolete constructor is removed
77+
specializedGetter != null
78+
? GenerateGetPropertyValueMethod(specializedGetter) ?? specializedGetter.Get
79+
: null,
80+
specializedSetter != null
81+
? GenerateSetPropertyValueMethod(specializedSetter) ?? specializedSetter.Set
82+
: null
7883
);
7984

8085
createInstanceMethod = CreateCreateInstanceMethod(mappedType);

0 commit comments

Comments
 (0)