fix: Fix bug in IF block generators. (#8780)

This commit is contained in:
michaela-mm
2025-02-24 15:35:33 +01:00
committed by GitHub
parent 7e44e81e42
commit d016801089
5 changed files with 17 additions and 5 deletions

View File

@@ -46,7 +46,9 @@ export function controls_if(block: Block, generator: DartGenerator) {
} while (block.getInput('IF' + n));
if (block.getInput('ELSE') || generator.STATEMENT_SUFFIX) {
branchCode = generator.statementToCode(block, 'ELSE');
branchCode = block.getInput('ELSE')
? generator.statementToCode(block, 'ELSE')
: '';
if (generator.STATEMENT_SUFFIX) {
branchCode =
generator.prefixLines(