From a5ab6149379d360dce679a88cd4ee334dcea580e Mon Sep 17 00:00:00 2001 From: David Fowler Date: Sat, 6 Dec 2014 10:35:37 -0800 Subject: [PATCH] Removed the null check for IApplicationBuilder --- src/Microsoft.AspNet.Hosting/Startup/StartupLoader.cs | 2 +- test/Microsoft.AspNet.Hosting.Tests/StartupManagerTests.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Microsoft.AspNet.Hosting/Startup/StartupLoader.cs b/src/Microsoft.AspNet.Hosting/Startup/StartupLoader.cs index 8063d48c44..3b300a1eca 100644 --- a/src/Microsoft.AspNet.Hosting/Startup/StartupLoader.cs +++ b/src/Microsoft.AspNet.Hosting/Startup/StartupLoader.cs @@ -57,7 +57,7 @@ namespace Microsoft.AspNet.Hosting.Startup private object Invoke(MethodInfo methodInfo, object instance, IApplicationBuilder builder, IServiceCollection services = null) { - var serviceProvider = builder?.ApplicationServices ?? _services; + var serviceProvider = builder.ApplicationServices ?? _services; var parameterInfos = methodInfo.GetParameters(); var parameters = new object[parameterInfos.Length]; for (var index = 0; index != parameterInfos.Length; ++index) diff --git a/test/Microsoft.AspNet.Hosting.Tests/StartupManagerTests.cs b/test/Microsoft.AspNet.Hosting.Tests/StartupManagerTests.cs index d9789bfccf..f3323b978a 100644 --- a/test/Microsoft.AspNet.Hosting.Tests/StartupManagerTests.cs +++ b/test/Microsoft.AspNet.Hosting.Tests/StartupManagerTests.cs @@ -29,7 +29,7 @@ namespace Microsoft.AspNet.Hosting.Tests var startup = manager.LoadStartup("Microsoft.AspNet.Hosting.Tests", "WithServices"); - startup.Invoke(null); + startup.Invoke(new ApplicationBuilder(services)); Assert.Equal(2, _configurationMethodCalledList.Count); }