Fixed a crash where if a null parameter was passed
This commit is contained in:
@@ -24,7 +24,8 @@ public class ComponentBuilder :
|
||||
services.AddScoped<IComponentHost, ComponentHost>();
|
||||
|
||||
services.AddScoped<IServiceFactory>(provider =>
|
||||
new ServiceFactory((type, parameters) => ActivatorUtilities.CreateInstance(provider, type, parameters!)));
|
||||
new ServiceFactory((type, parameters) => ActivatorUtilities.CreateInstance(provider, type,
|
||||
parameters?.Where(x => x is not null).ToArray()!)));
|
||||
|
||||
services.AddSingleton<IDisposer, Disposer>();
|
||||
|
||||
|
||||
@@ -18,7 +18,8 @@ public class DefaultHostBuilder :
|
||||
.ConfigureServices((context, services) =>
|
||||
{
|
||||
services.AddScoped<IServiceFactory>(provider =>
|
||||
new ServiceFactory((type, parameters) => ActivatorUtilities.CreateInstance(provider, type, parameters!)));
|
||||
new ServiceFactory((type, parameters) => ActivatorUtilities.CreateInstance(provider, type,
|
||||
parameters?.Where(x => x is not null).ToArray()!)));
|
||||
|
||||
services.AddSingleton<IComponentHostCollection,
|
||||
ComponentHostCollection>();
|
||||
|
||||
Reference in New Issue
Block a user