Use GetServiceOrDefault for optional dependency
This commit is contained in:
parent
25bbfa7165
commit
abbd763f0f
|
|
@ -78,7 +78,7 @@ namespace Microsoft.AspNet.Hosting
|
||||||
{
|
{
|
||||||
if (context.ServerFactory == null)
|
if (context.ServerFactory == null)
|
||||||
{
|
{
|
||||||
context.ServerFactory = context.Services.GetService<IServerFactory>();
|
context.ServerFactory = context.Services.GetServiceOrDefault<IServerFactory>();
|
||||||
}
|
}
|
||||||
if (context.ServerFactory != null)
|
if (context.ServerFactory != null)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue