From e39b70949efd78be80eb56d883781274ed8bdcab Mon Sep 17 00:00:00 2001 From: Tobias Schultze Date: Mon, 19 Nov 2012 15:19:02 +0100 Subject: [PATCH] [Routing] initialize the Route properties They should normally be initialized anyway in the constructor. But when extending the Route (like in CMF) and using an ORM/ODM to persist them in the DB, the constructor is not called. Then a new property that is not saved like hostnamePattern stays null which in turn makes the RouteCompiler fails as it expects '' instead of null. --- src/Symfony/Component/Routing/Route.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/Routing/Route.php b/src/Symfony/Component/Routing/Route.php index 83f9a0a3896c..abc37aa773ae 100644 --- a/src/Symfony/Component/Routing/Route.php +++ b/src/Symfony/Component/Routing/Route.php @@ -23,12 +23,12 @@ class Route implements \Serializable /** * @var string */ - private $pattern; + private $pattern = '/'; /** * @var string */ - private $hostnamePattern; + private $hostnamePattern = ''; /** * @var array