Skip to content

Commit a205cc6

Browse files
authored
Merge pull request #566 from TomHAnderson/hotfix/Yuml
Hotfix/yuml
2 parents fd3cde8 + 68feeec commit a205cc6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/DoctrineORMModule/Yuml/MetadataGrapher.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace DoctrineORMModule\Yuml;
44

55
use Doctrine\Common\Persistence\Mapping\ClassMetadata;
6+
use Exception;
67

78
/**
89
* Utility to generate Yuml compatible strings from metadata graphs
@@ -132,6 +133,9 @@ private function getClassReverseAssociationName(ClassMetadata $class1, ClassMeta
132133
{
133134
foreach ($class2->getAssociationNames() as $class2Side) {
134135
$targetClass = $this->getClassByName($class2->getAssociationTargetClass($class2Side));
136+
if (! $targetClass) {
137+
throw new Exception("Invalid class name for AssociationTargetClass $class2Side");
138+
}
135139
if ($class1->getName() === $targetClass->getName()) {
136140
return $class2Side;
137141
}

0 commit comments

Comments
 (0)