Skip to content

Commit

Permalink
json_decode() expects parameter 1 to be string, null given
Browse files Browse the repository at this point in the history
  • Loading branch information
Falseclock committed Jan 20, 2021
1 parent 8cff243 commit d8065a4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/DBD/Entity/Entity.php
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ private function setBaseColumns(Mapper $mapper)
$this->$setterMethod($columnValue);
} else {
/** If initially column type is json, then let's parse it as JSON */
if (!is_null($fieldDefinition->originType) && stripos($fieldDefinition->originType, "json") !== false) {
if (!is_null($columnValue) && !is_null($fieldDefinition->originType) && stripos($fieldDefinition->originType, "json") !== false) {
$this->$property = json_decode($columnValue, true);
} else {
/**
Expand Down

0 comments on commit d8065a4

Please sign in to comment.