summaryrefslogtreecommitdiff
path: root/css
diff options
context:
space:
mode:
Diffstat (limited to 'css')
-rw-r--r--css/css.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/css/css.c b/css/css.c
index 7b2656cdc..c4bbb8025 100644
--- a/css/css.c
+++ b/css/css.c
@@ -799,7 +799,8 @@ bool css_merge_rule_lists_internal(struct css_selector *l1, struct css_selector
/** \todo warn user? */
return false;
- if (a->specificity < b->specificity) {
+ if ((a && b && a->specificity < b->specificity) ||
+ (a && !b)) {
entry = memcpy(entry, a, sizeof(*entry));
a = a->next;
}