From 551daa4df2f4fd45a40d2e02e78b9617121bcb32 Mon Sep 17 00:00:00 2001 From: Justin Yost Date: Wed, 13 Dec 2017 14:12:06 -0800 Subject: [PATCH] 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 --- src/Entity/Product.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Entity/Product.php b/src/Entity/Product.php index e43b5b7..c66659c 100644 --- a/src/Entity/Product.php +++ b/src/Entity/Product.php @@ -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; } /**