(456804016) Handle exceptions thrown by GameAnalytics.SetEnabledInfoLog in debug builds

This commit is contained in:
Joonas Rikkonen
2019-06-04 15:30:14 +03:00
parent bce99f2e6f
commit 88c4c9a248
@@ -16,7 +16,16 @@ namespace Barotrauma
public static void Init() public static void Init()
{ {
#if DEBUG #if DEBUG
GameAnalytics.SetEnabledInfoLog(true); try
{
GameAnalytics.SetEnabledInfoLog(true);
}
catch (Exception e)
{
DebugConsole.ThrowError("Initializing GameAnalytics failed. Disabling user statistics...", e);
GameSettings.SendUserStatistics = false;
return;
}
#endif #endif
string exePath = Assembly.GetEntryAssembly().Location; string exePath = Assembly.GetEntryAssembly().Location;