Browse Source

Fix tests

release/11.0.0-preview3
Max Katz 4 years ago
parent
commit
9b4fc3d484
  1. 4
      src/Markup/Avalonia.Markup.Xaml/XamlIl/Runtime/XamlIlRuntimeHelpers.cs

4
src/Markup/Avalonia.Markup.Xaml/XamlIl/Runtime/XamlIlRuntimeHelpers.cs

@ -176,7 +176,7 @@ namespace Avalonia.Markup.Xaml.XamlIl.Runtime
public RootServiceProvider(INameScope nameScope)
{
_nameScope = nameScope;
_runtimePlatform = AvaloniaLocator.Current.GetRequiredService<IRuntimePlatform>();
_runtimePlatform = AvaloniaLocator.Current.GetService<IRuntimePlatform>();
}
public object GetService(Type serviceType)
@ -186,7 +186,7 @@ namespace Avalonia.Markup.Xaml.XamlIl.Runtime
if (serviceType == typeof(IAvaloniaXamlIlParentStackProvider))
return this;
if (serviceType == typeof(IRuntimePlatform))
return _runtimePlatform;
return _runtimePlatform ?? throw new KeyNotFoundException($"{nameof(IRuntimePlatform)} was not registered");
return null;
}

Loading…
Cancel
Save