Skip to content

Commit

Permalink
- Added NRE check for types list rebuilding.
Browse files Browse the repository at this point in the history
  • Loading branch information
TBN-MapleWheels committed Oct 26, 2023
1 parent 342a6bb commit 2a93114
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -798,7 +798,7 @@ internal LoadedACL(Guid id, AssemblyManager manager, string friendlyName)
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.
Expand All @@ -813,6 +813,12 @@ internal void ClearACLRef()
/// </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
{
Expand Down

0 comments on commit 2a93114

Please sign in to comment.