Browse Source

Fixed field initializer crash

Brian Fiete 5 years ago
parent
commit
a29f22d227
1 changed files with 2 additions and 2 deletions
  1. 2 2
      IDEHelper/Compiler/BfModule.cpp

+ 2 - 2
IDEHelper/Compiler/BfModule.cpp

@@ -3802,10 +3802,10 @@ BfTypedValue BfModule::GetFieldInitializerValue(BfFieldInstance* fieldInstance,
 	if (fieldInstance != NULL)
 		MarkFieldInitialized(fieldInstance);
 
-	if (doStore)
+	if ((doStore) && (result))
 	{
 		result = LoadValue(result);
-		if (!result.mType->IsValuelessType())		
+		if (!result.mType->IsValuelessType())
 			mBfIRBuilder->CreateStore(result.mValue, staticVarRef.mValue);		
 	}