diff --git a/lib/private/template/base.php b/lib/private/template/base.php index 72abc38c36..2c745b02a1 100644 --- a/lib/private/template/base.php +++ b/lib/private/template/base.php @@ -168,8 +168,13 @@ class Base { // Include ob_start(); - include $file; - $data = ob_get_contents(); + try { + include $file; + $data = ob_get_contents(); + } catch (\Exception $e) { + @ob_end_clean(); + throw $e; + } @ob_end_clean(); // Return data