Permalink
Browse files

Merge pull request #54 from iBiryukov/master

Fix for ConversionException throw when the value is empty
  • Loading branch information...
2 parents 4ae13fa + 869cb96 commit 3d82e0de13891fadddcec3006e30e250c6055b9e @guilhermeblanco guilhermeblanco committed Sep 7, 2011
Showing with 3 additions and 2 deletions.
  1. +3 −2 lib/Doctrine/DBAL/Types/ArrayType.php
@@ -38,10 +38,11 @@ public function convertToDatabaseValue($value, \Doctrine\DBAL\Platforms\Abstract
public function convertToPHPValue($value, \Doctrine\DBAL\Platforms\AbstractPlatform $platform)
{
- if ($value === null) {
- return null;
+ if (empty($value)) {
+ return array();
}
+
$value = (is_resource($value)) ? stream_get_contents($value) : $value;
$val = unserialize($value);
if ($val === false && $value != 'b:0;') {

0 comments on commit 3d82e0d

Please sign in to comment.