Skip to content

Commit 28d4b93

Browse files
committed
Handle null reference exception when TicketCacheBase.Refresh is null
1 parent 6828266 commit 28d4b93

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

Kerberos.NET/Cache/TicketCacheBase.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,10 @@ protected virtual async Task BackgroundCacheOperation()
158158

159159
if (cacheEntry != null && !cacheEntry.IsExpired(this.Configuration.Defaults.ClockSkew))
160160
{
161-
await (this.Refresh?.Invoke(cacheEntry)).ConfigureAwait(false);
161+
if (this.Refresh != null)
162+
{
163+
await this.Refresh.Invoke(cacheEntry).ConfigureAwait(false);
164+
}
162165
}
163166
}
164167

0 commit comments

Comments
 (0)