Skip to content

Commit f891c7e

Browse files
committed
Fix segfault with Ruleset::is_invisible()
1 parent 2fcd639 commit f891c7e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/ast.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1615,9 +1615,10 @@ namespace Sass {
16151615
}
16161616

16171617
bool Ruleset::is_invisible() const {
1618-
CommaSequence_Selector* sl = static_cast<CommaSequence_Selector*>(selector());
1619-
for (size_t i = 0, L = sl->length(); i < L; ++i)
1620-
if (!(*sl)[i]->has_placeholder()) return false;
1618+
if (CommaSequence_Selector* sl = dynamic_cast<CommaSequence_Selector*>(selector())) {
1619+
for (size_t i = 0, L = sl->length(); i < L; ++i)
1620+
if (!(*sl)[i]->has_placeholder()) return false;
1621+
}
16211622
return true;
16221623
}
16231624

0 commit comments

Comments
 (0)