Sfoglia il codice sorgente

Fixed `using` crash with failed fieldInstance

Brian Fiete 8 mesi fa
parent
commit
be3f688576
1 ha cambiato i file con 6 aggiunte e 3 eliminazioni
  1. 6 3
      IDEHelper/Compiler/BfModuleTypeUtils.cpp

+ 6 - 3
IDEHelper/Compiler/BfModuleTypeUtils.cpp

@@ -3256,9 +3256,12 @@ void BfModule::PopulateUsingFieldData(BfTypeInstance* typeInstance)
 			}
 			}
 
 
 			auto fieldInstance = &usingType->mFieldInstances[fieldDef->mIdx];
 			auto fieldInstance = &usingType->mFieldInstances[fieldDef->mIdx];
-			auto fieldTypeInst = fieldInstance->mResolvedType->ToTypeInstance();
-			if (fieldTypeInst != NULL)
-				_CheckType(fieldTypeInst, fieldDef->mIsStatic);
+			if (fieldInstance->mResolvedType != NULL)
+			{
+				auto fieldTypeInst = fieldInstance->mResolvedType->ToTypeInstance();
+				if (fieldTypeInst != NULL)
+					_CheckType(fieldTypeInst, fieldDef->mIsStatic);
+			}
 		}
 		}
 
 
 		for (auto propDef : usingType->mTypeDef->mProperties)
 		for (auto propDef : usingType->mTypeDef->mProperties)