Skip to content

Commit

Permalink
Merge pull request #12 from phoenix-labs/develop
Browse files Browse the repository at this point in the history
Merge Develop into Master
  • Loading branch information
Michael committed Mar 17, 2015
2 parents 9ef948e + 36ab0c0 commit fe85b32
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Phoenix/EloquentMeta/Helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,14 @@ public static function maybeDecode($value, $asArray = false)

$decoded = json_decode($value, $asArray);

return json_last_error() == JSON_ERROR_NONE ? $decoded : $value;
if (json_last_error() == JSON_ERROR_NONE){
return $decoded;
} else {
// Reset the JSON error code:
json_decode("[]");

return $value;
}
}

/**
Expand Down

0 comments on commit fe85b32

Please sign in to comment.