- Added NRE check for types list rebuilding.

This commit is contained in:
MapleWheels
2023-10-26 12:26:27 -04:00
parent 342a6bbcf9
commit 2a931142a0

View File

@@ -798,7 +798,7 @@ public class AssemblyManager
FriendlyName = friendlyName
};
}
public ImmutableDictionary<string, Type> AssembliesTypes => _assembliesTypes;
public ref readonly ImmutableDictionary<string, Type> AssembliesTypes => ref _assembliesTypes;
/// <summary>
/// Warning: For use by the Assembly Manager only! Do not call this method otherwise.
@@ -813,6 +813,12 @@ public class AssemblyManager
/// </summary>
internal void RebuildTypesList()
{
if (this.Acl is null)
{
ModUtils.Logging.PrintWarning($"{nameof(RebuildTypesList)}() | ACL with GUID {Id.ToString()} is null, cannot rebuild.");
return;
}
ClearTypesList();
try
{