Change InstalledAddon API

This commit is contained in:
Nick 2022-05-03 11:38:41 -04:00
parent 9383722480
commit ff22b3246c

View File

@ -445,7 +445,15 @@ namespace NewHorizons
public string[] GetInstalledAddons() public string[] GetInstalledAddons()
{ {
return Main.MountedAddons.Select(x => x.ModHelper.Manifest.UniqueName).ToArray(); try
{
return Main.MountedAddons.Select(x => x?.ModHelper?.Manifest?.UniqueName).ToArray();
}
catch (Exception ex)
{
Logger.LogError($"Couldn't get installed addons {ex.Message}, {ex.StackTrace}");
return new string[] { };
}
} }
} }
#endregion API #endregion API