1
0
mirror of synced 2024-12-04 18:56:06 +03:00

Fix crashes in ConvertMappingCommand and GenerateEntitiesCommand when using entities with joined table inheritance

ConvertMappingCommand and GenerateEntitiesCommand both use the DisconnectedClassMetadataFactory, which allows metadata manipulation without loading the associated classes. Commit a36bea broke these two commands by adding a bailout condition in ClassMetadataFactory::populateDiscriminatorValue which checks $metadata->reflClass->isAbstract(). If the DisconnectedClassMetadataFactory is being used, $metadata->reflClass will always be null, causing a fatal error, "Fatal error: Call to a member function isAbstract() on null".

This commit adds a check to see if $metadata->reflClass is set before checking isAbstract.
This commit is contained in:
Bill Schaller 2015-03-20 13:59:27 -04:00
parent 24425436b0
commit 4b10db3a43

View File

@ -311,6 +311,7 @@ class ClassMetadataFactory extends AbstractClassMetadataFactory
if ($metadata->discriminatorValue
|| ! $metadata->discriminatorMap
|| $metadata->isMappedSuperclass
|| ! $metadata->reflClass
|| $metadata->reflClass->isAbstract()
) {
return;