Skip to content

Commit

Permalink
Handle Cases in Product where Text Does Not Exist
Browse files Browse the repository at this point in the history
There are cases where returning a Product Entity, the text field does not exist. This catches that issue.

Signed-off-by: Justin Yost <[email protected]>
  • Loading branch information
justinyost committed Dec 13, 2017
1 parent 3cdce8c commit 551daa4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Entity/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ public function getType()

/**
* Text description, if available, of the product
* @return string
* @return string|null
*/
public function getText()
{
return $this->data['text'];
return (isset($this->data['text'])) ? $this->data['text'] : null;
}

/**
Expand Down

0 comments on commit 551daa4

Please sign in to comment.