Add a null check in generated bytecode involving blocks