Skip to content

Commit

Permalink
Check if Document has getHeadData method (#16)
Browse files Browse the repository at this point in the history
* Check if Document has getHeadData method

Fixes i.e. JsonDocument calls

* Update httpheader.php
  • Loading branch information
SniperSister authored and zero-24 committed Aug 15, 2019
1 parent 2249980 commit 056a459
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions httpheader.php
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,12 @@ public function onAfterRender()
{
$scriptHashesEnabled = (int) $this->params->get('script_hashes_enabled', 0);
$styleHashesEnabled = (int) $this->params->get('style_hashes_enabled', 0);

if (!method_exists(Factory::getDocument(), 'getHeadData'))
{
return;
}

$headData = Factory::getDocument()->getHeadData();
$scriptHashes = [];
$styleHashes = [];
Expand Down

0 comments on commit 056a459

Please sign in to comment.