diff --git a/Classes/ViewHelpers/TryViewHelper.php b/Classes/ViewHelpers/TryViewHelper.php
index be6edbba5..f32a75139 100644
--- a/Classes/ViewHelpers/TryViewHelper.php
+++ b/Classes/ViewHelpers/TryViewHelper.php
@@ -50,7 +50,9 @@
*
- *
+ *
+ *
+ *
* Displayed only if the JSON decode worked. Much more code and many more
* ViewHelpers can go here. Now, imagine that this block spans so much code
* that potentially there could come an Exception from many additional places
@@ -103,7 +105,11 @@ public static function renderStatic(
RenderingContextInterface $renderingContext
) {
try {
- $content = $arguments['__then']();
+ if (isset($arguments['__then'])) {
+ $content = $arguments['__then']();
+ } else {
+ $content = '';
+ }
} catch (\Exception $error) {
$variableProvider = $renderingContext->getVariableProvider();
if (isset($arguments['__else'])) {
@@ -123,7 +129,7 @@ public static function renderStatic(
public function render()
{
try {
- $content = $this->renderChildren();
+ $content = $this->renderThenChild();
} catch (\Exception $error) {
$this->renderingContext->getVariableProvider()->add('exception', $error);
$content = $this->renderElseChild();
diff --git a/Documentation/ViewHelpers/Try.rst b/Documentation/ViewHelpers/Try.rst
index 8b0515826..f5a5da827 100644
--- a/Documentation/ViewHelpers/Try.rst
+++ b/Documentation/ViewHelpers/Try.rst
@@ -49,7 +49,9 @@ from this and imagine that a plain Exception happens on errors.
-
+
+
+
Displayed only if the JSON decode worked. Much more code and many more
ViewHelpers can go here. Now, imagine that this block spans so much code
that potentially there could come an Exception from many additional places