Skip to content

Commit

Permalink
Merge pull request #54 from iBiryukov/master
Browse files Browse the repository at this point in the history
Fix for ConversionException throw when the value is empty
  • Loading branch information
guilhermeblanco committed Sep 7, 2011
2 parents 4ae13fa + 869cb96 commit 3d82e0d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/Doctrine/DBAL/Types/ArrayType.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;') {
Expand Down

0 comments on commit 3d82e0d

Please sign in to comment.