diff --git a/Dalamud/Dalamud.cs b/Dalamud/Dalamud.cs index 37375d87b..e78776955 100644 --- a/Dalamud/Dalamud.cs +++ b/Dalamud/Dalamud.cs @@ -10,6 +10,7 @@ using Dalamud.Game; using Dalamud.Game.Gui.Internal; using Dalamud.Interface.Internal; using Dalamud.Plugin.Internal; +using Dalamud.Utility; using Serilog; #if DEBUG @@ -81,6 +82,7 @@ internal sealed class Dalamud : IServiceType catch (Exception e) { Log.Error(e, "Service initialization failure"); + Util.Fatal("Dalamud could not initialize correctly. Please report this error. \n\nThe game will continue, but you may not be able to use plugins.", "Dalamud", false); } finally { diff --git a/Dalamud/ServiceManager.cs b/Dalamud/ServiceManager.cs index eb4c2eb51..f237d8e57 100644 --- a/Dalamud/ServiceManager.cs +++ b/Dalamud/ServiceManager.cs @@ -138,8 +138,9 @@ internal static class ServiceManager Debug.Assert(!serviceKind.HasFlag(ServiceKind.ManualService), "Regular services should never end up here"); - var getTask = (Task)typeof(Service<>) - .MakeGenericType(serviceType) + var genericWrappedServiceType = typeof(Service<>).MakeGenericType(serviceType); + + var getTask = (Task)genericWrappedServiceType .InvokeMember( "GetAsync", BindingFlags.InvokeMethod | BindingFlags.Static | BindingFlags.Public, @@ -149,7 +150,7 @@ internal static class ServiceManager if (serviceKind.HasFlag(ServiceKind.BlockingEarlyLoadedService)) { - getAsyncTaskMap[typeof(Service<>).MakeGenericType(serviceType)] = getTask; + getAsyncTaskMap[serviceType] = getTask; blockingEarlyLoadingServices.Add(serviceType); } else