Skip to content

Commit 551daa4

Browse files
committed
Handle Cases in Product where Text Does Not Exist
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]>
1 parent 3cdce8c commit 551daa4

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)