Skip to content

Commit

Permalink
Fix for non-valid assets shown up as empty tags
Browse files Browse the repository at this point in the history
  • Loading branch information
rhukster committed Nov 24, 2014
1 parent a910568 commit d38a097
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions system/src/Grav/Common/Assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ public function addCss($asset, $priority = 10, $pipeline = true)
$asset = $this->buildLocalLink($asset);
}

if (!array_key_exists($asset, $this->css)) {
if ($asset && !array_key_exists($asset, $this->css)) {
$this->css[$asset] = [
'asset' => $asset,
'priority' => $priority,
Expand Down Expand Up @@ -272,8 +272,7 @@ public function addJs($asset, $priority = 10, $pipeline = true)
$asset = $this->buildLocalLink($asset);
}

if (!array_key_exists($asset, $this->js)) {

if ($asset && !array_key_exists($asset, $this->js)) {
$this->js[$asset] = [
'asset' => $asset,
'priority' => $priority,
Expand Down Expand Up @@ -656,7 +655,7 @@ protected function buildLocalLink($asset)
} catch (\Exception $e) {
}

return $this->base_url . ltrim($asset, '/');
return $asset ? $this->base_url . ltrim($asset, '/') : false;
}

/**
Expand Down

0 comments on commit d38a097

Please sign in to comment.