Skip to content
This repository was archived by the owner on Sep 16, 2021. It is now read-only.

Commit ce6c9ec

Browse files
committed
throw exception if the base path node does not exist
1 parent 31a7eef commit ce6c9ec

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Adapter/PhpcrOdmAdapter.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,12 @@ public function createAutoRoute($uri, $contentDocument, $autoRouteTag)
118118
{
119119
$path = $this->baseRoutePath;
120120
$document = $parentDocument = $this->dm->find(null, $path);
121+
if (null === $parentDocument) {
122+
throw new \RuntimeException(sprintf('The "route_basepath" configuration points to a non existant path "%s".',
123+
$path
124+
));
125+
}
126+
121127
$segments = preg_split('#/#', $uri, null, PREG_SPLIT_NO_EMPTY);
122128
$headName = array_pop($segments);
123129
foreach ($segments as $segment) {

0 commit comments

Comments
 (0)