diff --git a/src/ast_selectors.cpp b/src/ast_selectors.cpp index 76547d86b..3327350ac 100644 --- a/src/ast_selectors.cpp +++ b/src/ast_selectors.cpp @@ -88,7 +88,7 @@ namespace Sass { bool Selector_Schema::has_parent_ref() const { if (String_Schema_Obj schema = Cast(contents())) { - return schema->length() > 0 && Cast(schema->at(0)) != NULL; + return !schema->empty() && typeid(*schema->at(0)) == typeid(Parent_Selector); } return false; } @@ -96,8 +96,7 @@ namespace Sass { bool Selector_Schema::has_real_parent_ref() const { if (String_Schema_Obj schema = Cast(contents())) { - if (schema->length() == 0) return false; - return Cast(schema->at(0)); + return !schema->empty() && typeid(*schema->at(0)) == typeid(Parent_Reference); } return false; }