diff --git a/libs/sysplugins/smarty_internal_method_mustcompile.php b/libs/sysplugins/smarty_internal_method_mustcompile.php index 7766a75e..f28a68e6 100644 --- a/libs/sysplugins/smarty_internal_method_mustcompile.php +++ b/libs/sysplugins/smarty_internal_method_mustcompile.php @@ -31,7 +31,7 @@ class Smarty_Internal_Method_MustCompile public function mustCompile(Smarty_Internal_Template $_template) { if (!$_template->source->exists) { - if ($_template->parent->_objType == 2) { + if (isset($_template->parent) && $_template->parent->_objType == 2) { $parent_resource = " in '$_template->parent->template_resource}'"; } else { $parent_resource = ''; diff --git a/libs/sysplugins/smarty_internal_nocache_insert.php b/libs/sysplugins/smarty_internal_nocache_insert.php index 916bd8cc..b3d5fa86 100644 --- a/libs/sysplugins/smarty_internal_nocache_insert.php +++ b/libs/sysplugins/smarty_internal_nocache_insert.php @@ -42,7 +42,7 @@ class Smarty_Internal_Nocache_Insert $_output .= "echo {$_function}(" . var_export($_attr, true) . ",\$_smarty_tpl);?>"; } $_tpl = $_template; - while ($_tpl->parent->_objType == 2) { + while (isset($_tpl->parent) && $_tpl->parent->_objType == 2) { $_tpl = $_tpl->parent; } diff --git a/libs/sysplugins/smarty_internal_resource_file.php b/libs/sysplugins/smarty_internal_resource_file.php index 2fe2421f..47736892 100644 --- a/libs/sysplugins/smarty_internal_resource_file.php +++ b/libs/sysplugins/smarty_internal_resource_file.php @@ -35,7 +35,7 @@ class Smarty_Internal_Resource_File extends Smarty_Resource return is_file($file) ? $file : false; } // go relative to a given template? - if ($file[0] == '.' && $_template && $_template->parent->_objType == 2 && + if ($file[0] == '.' && $_template && isset($_template->parent) && $_template->parent->_objType == 2 && preg_match('#^[.]{1,2}[\\\/]#', $file) ) { if ($_template->parent->source->type != 'file' && $_template->parent->source->type != 'extends' && diff --git a/libs/sysplugins/smarty_internal_resource_php.php b/libs/sysplugins/smarty_internal_resource_php.php index 0bb99b4a..62680625 100644 --- a/libs/sysplugins/smarty_internal_resource_php.php +++ b/libs/sysplugins/smarty_internal_resource_php.php @@ -72,7 +72,7 @@ class Smarty_Internal_Resource_Php extends Smarty_Internal_Resource_File throw new SmartyException("PHP templates are disabled"); } if (!$source->exists) { - if ($_template->parent->_objType == 2) { + if (isset($_template->parent) && $_template->parent->_objType == 2) { $parent_resource = " in '{$_template->parent->template_resource}'"; } else { $parent_resource = '';