Skip to content

Commit 0a6bfc7

Browse files
committed
Add missing tests for the switch backdrop to and wait block
1 parent 3421390 commit 0a6bfc7

File tree

2 files changed

+284
-36
lines changed

2 files changed

+284
-36
lines changed

src/blocks/looksblocks.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -497,10 +497,10 @@ unsigned int LooksBlocks::randomBackdropAndWait(VirtualMachine *vm)
497497

498498
unsigned int LooksBlocks::checkBackdropScripts(VirtualMachine *vm)
499499
{
500-
Stage *stage = vm->engine()->stage();
501-
502-
if (stage && vm->engine()->broadcastByPtrRunning(stage->costumeAt(stage->currentCostume() - 1)->broadcast(), vm))
503-
vm->stop(true, true, true);
500+
if (Stage *stage = vm->engine()->stage()) {
501+
if ((stage->costumes().size() > 0) && vm->engine()->broadcastByPtrRunning(stage->costumeAt(stage->currentCostume() - 1)->broadcast(), vm))
502+
vm->stop(true, true, true);
503+
}
504504

505505
return 0;
506506
}

0 commit comments

Comments
 (0)