Skip to content

Commit 89ae633

Browse files
authored
Merge pull request #372 from TimHess/null_refresh
Handle null reference exception when TicketCacheBase.Refresh is null
2 parents 6828266 + 320b407 commit 89ae633

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Kerberos.NET/Cache/TicketCacheBase.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ 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+
await (this.Refresh?.Invoke(cacheEntry) ?? Task.CompletedTask).ConfigureAwait(false);
162162
}
163163
}
164164

0 commit comments

Comments
 (0)