Skip to content

Commit

Permalink
[css] Check NULL
Browse files Browse the repository at this point in the history
  • Loading branch information
rkd77 committed Aug 24, 2024
1 parent cdada4b commit 4548609
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/document/libdom/css.c
Original file line number Diff line number Diff line change
Expand Up @@ -2135,6 +2135,10 @@ select_css(struct html_context *html_context, struct html_element *html_element)
return;
}

if (!style->styles[CSS_PSEUDO_ELEMENT_NONE]) {
goto end;
}

color_type = css_computed_color(
style->styles[CSS_PSEUDO_ELEMENT_NONE],
&color_shade);
Expand Down Expand Up @@ -2199,6 +2203,7 @@ fprintf(stderr, "Before: %s:%d\n", __FUNCTION__, __LINE__);
apply_text_align(html_context, html_element, text_align);
}

end:
code = css_select_results_destroy(style);
if (code != CSS_OK) {
fprintf(stderr, "css_computed_style_destroy code=%d\n", code);
Expand Down

0 comments on commit 4548609

Please sign in to comment.