Skip to content

Commit 473bf03

Browse files
Fix null set handling
1 parent 40e223c commit 473bf03

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/NHibernate/Cache/NonstrictReadWriteCache.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public ICache Cache
3333
#pragma warning restore 618
3434
{
3535
get { return _cache; }
36-
set { _cache = value.AsCacheBase(); }
36+
set { _cache = value?.AsCacheBase(); }
3737
}
3838

3939
// 6.0 TODO: make implicit and switch to auto-property

src/NHibernate/Cache/ReadOnlyCache.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public ICache Cache
2929
#pragma warning restore 618
3030
{
3131
get { return _cache; }
32-
set { _cache = value.AsCacheBase(); }
32+
set { _cache = value?.AsCacheBase(); }
3333
}
3434

3535
// 6.0 TODO: make implicit and switch to auto-property

src/NHibernate/Cache/ReadWriteCache.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public ICache Cache
5151
#pragma warning restore 618
5252
{
5353
get { return _cache; }
54-
set { _cache = value.AsCacheBase(); }
54+
set { _cache = value?.AsCacheBase(); }
5555
}
5656

5757
// 6.0 TODO: make implicit and switch to auto-property

0 commit comments

Comments
 (0)