Skip to content

Commit 77a6f27

Browse files
committed
Block: Add null check to compile()
1 parent 688609f commit 77a6f27

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/scratch/block.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ Block::Block(const std::string &id, const std::string &opcode) :
1818
/*! Calls the compile function. */
1919
void Block::compile(Compiler *compiler)
2020
{
21-
return impl->compileFunction(compiler);
21+
if (impl->compileFunction)
22+
return impl->compileFunction(compiler);
2223
}
2324

2425
/*! Returns the opcode. */

0 commit comments

Comments
 (0)