Skip to content

Commit 5d49e6c

Browse files
authored
Merge pull request #62 from justinyost/issue-61-product-text-field
Handle Cases in Product where Text Does Not Exist
2 parents dd86b91 + 551daa4 commit 5d49e6c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Entity/Product.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ public function getType()
3737

3838
/**
3939
* Text description, if available, of the product
40-
* @return string
40+
* @return string|null
4141
*/
4242
public function getText()
4343
{
44-
return $this->data['text'];
44+
return (isset($this->data['text'])) ? $this->data['text'] : null;
4545
}
4646

4747
/**

0 commit comments

Comments
 (0)