Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Ig0r-M-magic42/479d48832c659874b138229f8625ab98 to your computer and use it in GitHub Desktop.
Save Ig0r-M-magic42/479d48832c659874b138229f8625ab98 to your computer and use it in GitHub Desktop.
diff --git a/Helper/MagentoDataHelper.php b/Helper/MagentoDataHelper.php
index 992edc3..b2d94fa 100644
--- a/Helper/MagentoDataHelper.php
+++ b/Helper/MagentoDataHelper.php
@@ -478,7 +478,7 @@ class MagentoDataHelper extends AbstractHelper
}
private function hashValue($string){
- return hash('sha256', strtolower($string));
+ return hash('sha256', strtolower($string ?? ''));
}
// TODO Remaining user/custom data methods that can be obtained using Magento.
diff --git a/Model/Feed/CategoryCollection.php b/Model/Feed/CategoryCollection.php
index de32055..0a39a2c 100644
--- a/Model/Feed/CategoryCollection.php
+++ b/Model/Feed/CategoryCollection.php
@@ -302,7 +302,7 @@ class CategoryCollection
$this->fbeHelper->logException($e);
}
$this->fbeHelper->log("response from fb: ".$response);
- $response_obj = json_decode($response, true);
+ $response_obj = json_decode($response, true) ?? [];
if (array_key_exists('id', $response_obj)) {
$set_id = $response_obj['id'];
$this->saveFBProductSetID($category, $set_id);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment