mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-11-02 11:26:04 +01:00
Ensuring plugin and themes objects exist before continuing
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user