Skip to content

Commit

Permalink
Fix type error when no consents have been set yet
Browse files Browse the repository at this point in the history
Fixes #47
  • Loading branch information
kdambekalns authored and Nikdro committed Nov 1, 2022
1 parent 9eb1592 commit 982b024
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Classes/Controller/JavaScriptController.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ function ($key) {
);

$cookie = json_decode($this->request->getHttpRequest()->getCookieParams()[$this->cookieName], true);
$consents = $cookie['consents'][$dimensionIdentifier] ?? $cookie['consents']['default'] ?? $cookie['consents'];
$consents = $cookie['consents'][$dimensionIdentifier] ?? $cookie['consents']['default'] ?? $cookie['consents'] ?? [];
$siteNode = $this->contextFactory->create(['dimensions' => $dimensions])->getCurrentSiteNode();

$cacheIdentifier = 'kd_gdpr_cc_' . sha1(json_encode($consents) . $dimensionIdentifier . $siteNode->getIdentifier());
Expand Down

0 comments on commit 982b024

Please sign in to comment.