diff --git a/src/View/Antlers/Language/Runtime/NodeProcessor.php b/src/View/Antlers/Language/Runtime/NodeProcessor.php
index 1d7bf42b81a..a20730d1080 100644
--- a/src/View/Antlers/Language/Runtime/NodeProcessor.php
+++ b/src/View/Antlers/Language/Runtime/NodeProcessor.php
@@ -1137,7 +1137,7 @@ protected function checkPartialForNamedSlots(AntlersNode $node)
$namedSlots = [];
foreach ($node->children as $child) {
- if ($child instanceof AntlersNode && ! $child->isComment && $child->name->name == 'slot') {
+ if ($child instanceof AntlersNode && ! $child->isComment && $child->isPaired() && $child->name->name == 'slot') {
$namedSlots[$child->name->methodPart] = $child;
}
}
diff --git a/tests/Antlers/Runtime/PartialsTest.php b/tests/Antlers/Runtime/PartialsTest.php
index 223a3f2c555..bb0172bd71b 100644
--- a/tests/Antlers/Runtime/PartialsTest.php
+++ b/tests/Antlers/Runtime/PartialsTest.php
@@ -95,4 +95,27 @@ public function test_assignments_in_earlier_partials_do_not_blank_a_later_partia
$this->assertSame('FILTERhi
The Body
{{ /slot:body }} +{{ /partial:accordion }} +EOT; + + $accordion = <<<'EOT' +The Body