From 91860afd8036150b977d72a55a4cf36c88c2a768 Mon Sep 17 00:00:00 2001 From: nobohan Date: Fri, 30 Apr 2021 13:51:45 +0200 Subject: [PATCH] check if point value is null for 2 methods in PointType --- .../ChillMainBundle/Doctrine/Type/PointType.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Doctrine/Type/PointType.php b/src/Bundle/ChillMainBundle/Doctrine/Type/PointType.php index 6b6f7c113..086b566da 100644 --- a/src/Bundle/ChillMainBundle/Doctrine/Type/PointType.php +++ b/src/Bundle/ChillMainBundle/Doctrine/Type/PointType.php @@ -36,7 +36,11 @@ class PointType extends Type { */ public function convertToPHPValue($value, AbstractPlatform $platform) { - return Point::fromGeoJson($value); + if ($value === NULL){ + return NULL; + } else { + return Point::fromGeoJson($value); + } } public function getName() @@ -46,7 +50,11 @@ class PointType extends Type { public function convertToDatabaseValue($value, AbstractPlatform $platform) { - return $value->toWKT(); + if ($value === NULL){ + return NULL; + } else { + return $value->toWKT(); + } } public function canRequireSQLConversion()