Skip to content

Commit bf36ce3

Browse files
committed
Fix segfault when extending pseudo selectors failed (#2366)
1 parent e73be95 commit bf36ce3

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/extend.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1947,8 +1947,10 @@ namespace Sass {
19471947
Wrapped_Selector_Obj cpy_ws = SASS_MEMORY_COPY(ws);
19481948
Selector_List_Obj cpy_ws_sl = SASS_MEMORY_NEW(Selector_List, sl->pstate());
19491949
// remove parent selectors from inner selector
1950-
if (ext_cs->first() && ext_cs->first()->head()->length() > 0) {
1951-
Wrapped_Selector_Ptr ext_ws = Cast<Wrapped_Selector>(ext_cs->first()->head()->first());
1950+
Compound_Selector_Obj ext_head = NULL;
1951+
if (ext_cs->first()) ext_head = ext_cs->first()->head();
1952+
if (ext_head && ext_head && ext_head->length() > 0) {
1953+
Wrapped_Selector_Ptr ext_ws = Cast<Wrapped_Selector>(ext_head->first());
19521954
if (ext_ws/* && ext_cs->length() == 1*/) {
19531955
Selector_List_Obj ws_cs = Cast<Selector_List>(ext_ws->selector());
19541956
Compound_Selector_Obj ws_ss = ws_cs->first()->head();

0 commit comments

Comments
 (0)