From 063bb9ea8b857f27076ddd96ebb3f58b50a31204 Mon Sep 17 00:00:00 2001 From: Marcel Greter Date: Sat, 14 Mar 2015 15:16:31 +0100 Subject: [PATCH] Refine illegal extend error across media-queries Fixes https://github.com/sass/libsass/issues/943 --- extend.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/extend.cpp b/extend.cpp index 0e1a7465a..7b93aa5ad 100644 --- a/extend.cpp +++ b/extend.cpp @@ -1679,9 +1679,11 @@ namespace Sass { // check if both selectors have the same media block parent if (ext.first->media_block() == pComplexSelector->media_block()) continue; To_String to_string(&ctx); - if (ext.second->media_block() && ext.second->media_block()->media_queries() && - pComplexSelector->media_block() && pComplexSelector->media_block()->media_queries()) - { + if (ext.second->media_block() == 0) continue; + if (pComplexSelector->media_block() && + ext.second->media_block()->media_queries() && + pComplexSelector->media_block()->media_queries() + ) { string query_left(ext.second->media_block()->media_queries()->perform(&to_string)); string query_right(pComplexSelector->media_block()->media_queries()->perform(&to_string)); if (query_left == query_right) continue;