Ensuring plugin and themes objects exist before continuing

This commit is contained in:
Djamil Legato
2015-11-19 20:06:08 -08:00
parent 69f883823a
commit 98ca723214

View File

@@ -312,6 +312,9 @@ class Admin
/** @var Plugins $plugins */
$plugins = $this->grav['plugins'];
$obj = $plugins->get(preg_replace('|plugins/|', '', $type));
if (!$obj) { return []; }
$obj->merge($post);
$obj->file($file);
@@ -320,6 +323,9 @@ class Admin
/** @var Themes $themes */
$themes = $this->grav['themes'];
$obj = $themes->get(preg_replace('|themes/|', '', $type));
if (!$obj) { return []; }
$obj->merge($post);
$obj->file($file);