Skip to content

Commit

Permalink
Fixed possible NRE
Browse files Browse the repository at this point in the history
  • Loading branch information
HolyPrapor committed Oct 14, 2021
1 parent b84b674 commit 6470e0f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Vostok.Hosting/Components/BuildContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ private void TryDispose(object component, string componentName, bool shouldLog =

private void TryDisposeImplicitComponents()
{
var registeredExtensions = new HashSet<object>(HostExtensions.GetAll().Select(x => x.Item2), ByReferenceEqualityComparer<object>.Instance);
var registeredExtensions = new HashSet<object>(HostExtensions?.GetAll().Select(x => x.Item2) ?? new List<object>(), ByReferenceEqualityComparer<object>.Instance);

foreach (var disposable in disposables ?? new List<object>())
TryDispose(disposable, $"{disposable.GetType().Name} extension", registeredExtensions.Contains(disposable));
Expand Down

0 comments on commit 6470e0f

Please sign in to comment.