Skip to content

Commit 6be2a96

Browse files
committed
Revert "stylesheet: No need to NULL guard lwc_string_unref"
This reverts commit e82041b.
1 parent e82041b commit 6be2a96

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/stylesheet.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -854,7 +854,8 @@ css_error css__stylesheet_selector_destroy(css_stylesheet *sheet,
854854
d = c->combinator;
855855

856856
for (detail = &c->data; detail;) {
857-
lwc_string_unref(detail->qname.ns);
857+
if (detail->qname.ns != NULL)
858+
lwc_string_unref(detail->qname.ns);
858859
lwc_string_unref(detail->qname.name);
859860

860861
if (detail->value_type ==
@@ -873,7 +874,8 @@ css_error css__stylesheet_selector_destroy(css_stylesheet *sheet,
873874
}
874875

875876
for (detail = &selector->data; detail;) {
876-
lwc_string_unref(detail->qname.ns);
877+
if (detail->qname.ns != NULL)
878+
lwc_string_unref(detail->qname.ns);
877879
lwc_string_unref(detail->qname.name);
878880

879881
if (detail->value_type == CSS_SELECTOR_DETAIL_VALUE_STRING &&
@@ -1152,7 +1154,8 @@ css_error css__stylesheet_rule_destroy(css_stylesheet *sheet, css_rule *rule)
11521154
{
11531155
css_rule_import *import = (css_rule_import *) rule;
11541156

1155-
lwc_string_unref(import->url);
1157+
if (import->url != NULL)
1158+
lwc_string_unref(import->url);
11561159

11571160
if (import->media != NULL) {
11581161
css__mq_query_destroy(import->media);

0 commit comments

Comments
 (0)