Merge pull request #424 from SHADE-DP/SP3-6-c-scripting

Added proper handling for loaded null managed assemblies
This commit is contained in:
XiaoQiDigipen 2023-03-10 22:43:55 +08:00 committed by GitHub
commit bc567f626f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -882,6 +882,11 @@ namespace SHADE
System::Collections::Generic::IEnumerable<System::Type^>^ selectorFunc(System::Reflection::Assembly^ assembly) System::Collections::Generic::IEnumerable<System::Type^>^ selectorFunc(System::Reflection::Assembly^ assembly)
{ {
if (assembly == nullptr)
{
Debug::LogError("[ScriptStore] Received null assembly while collecting Script types. This should not happen!");
return nullptr;
}
return assembly->GetExportedTypes(); return assembly->GetExportedTypes();
} }
Pair^ resultSelectorFunc(System::Reflection::Assembly^ assembly, System::Type^ type) Pair^ resultSelectorFunc(System::Reflection::Assembly^ assembly, System::Type^ type)