From ab5b26e59debe292413a6ef8b6f7bd3829d1e5a3 Mon Sep 17 00:00:00 2001 From: pushkin Date: Sun, 5 Apr 2020 16:44:37 +0200 Subject: [PATCH] if_block exists check missing in block.p #4629 fix --- src/compiler/compile/render_dom/wrappers/IfBlock.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/compiler/compile/render_dom/wrappers/IfBlock.ts b/src/compiler/compile/render_dom/wrappers/IfBlock.ts index 207e1e349e..4dcbb43a39 100644 --- a/src/compiler/compile/render_dom/wrappers/IfBlock.ts +++ b/src/compiler/compile/render_dom/wrappers/IfBlock.ts @@ -334,7 +334,11 @@ export default class IfBlockWrapper extends Wrapper { `); } } else if (dynamic) { - block.chunks.update.push(b`${name}.p(#ctx, #dirty);`); + if (if_exists_condition) { + block.chunks.update.push(b`if (${if_exists_condition}) ${name}.p(#ctx, #dirty);`); + } else { + block.chunks.update.push(b`${name}.p(#ctx, #dirty);`); + } } if (if_exists_condition) {