From d38a0973c6bd7bb7bae5cc3b152eb063bd7da1b9 Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Mon, 24 Nov 2014 11:51:25 -0700 Subject: [PATCH] Fix for non-valid assets shown up as empty tags --- system/src/Grav/Common/Assets.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/system/src/Grav/Common/Assets.php b/system/src/Grav/Common/Assets.php index 29397cf29..2270016ce 100644 --- a/system/src/Grav/Common/Assets.php +++ b/system/src/Grav/Common/Assets.php @@ -234,7 +234,7 @@ class Assets $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, @@ -272,8 +272,7 @@ class Assets $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, @@ -656,7 +655,7 @@ class Assets } catch (\Exception $e) { } - return $this->base_url . ltrim($asset, '/'); + return $asset ? $this->base_url . ltrim($asset, '/') : false; } /**