Skip to content

Commit

Permalink
Fix BlockBody#blank?
Browse files Browse the repository at this point in the history
  • Loading branch information
peterzhu2118 committed Jan 11, 2021
1 parent 10e9294 commit dd35354
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ext/liquid_c/block.c
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,10 @@ static VALUE block_body_blank_p(VALUE self)
{
block_body_t *body;
BlockBody_Get_Struct(self, body);
if (body->compiled) {
if (body->from_serialize) {
block_body_header_t *body_header = document_body_get_block_body_header_ptr(&body->as.serialize.document_body_entry);
return BLOCK_BODY_HEADER_BLANK_P(body_header) ? Qtrue : Qfalse;
} else if (body->compiled) {
block_body_header_t *body_header = document_body_get_block_body_header_ptr(&body->as.compiled.document_body_entry);
return BLOCK_BODY_HEADER_BLANK_P(body_header) ? Qtrue : Qfalse;
} else {
Expand Down

0 comments on commit dd35354

Please sign in to comment.