Prevent Services from being set twice

This commit is contained in:
Raymond 2021-08-22 07:57:50 -04:00
parent 797bcade90
commit 9f863a4dbb

View file

@ -42,6 +42,9 @@ namespace Dalamud
/// <returns>The set object.</returns>
public static T Set()
{
if (instance != null)
throw new Exception($"Service {typeof(T).FullName} was set twice");
var obj = (T?)Activator.CreateInstance(typeof(T), true);
SetInstanceObject(obj);