From 23f511cd2552844bcbe8e00e96a723efba21c26a Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Date: Sun, 23 Dec 2018 00:17:07 +0100 Subject: Fix create first selector --- src/style.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/style.cpp') diff --git a/src/style.cpp b/src/style.cpp index 203abc608..aab8f2695 100644 --- a/src/style.cpp +++ b/src/style.cpp @@ -817,10 +817,14 @@ SPStyle::mergeString( gchar const *const p ) { */ void SPStyle::mergeStatement( CRStatement *statement ) { - if (statement->type != RULESET_STMT) return; - CRDeclaration *decl_list = NULL; + if (statement->type != RULESET_STMT) { + return; + } + CRDeclaration *decl_list = nullptr; cr_statement_ruleset_get_declarations (statement, &decl_list); - _mergeDeclList(decl_list, SP_STYLE_SRC_STYLE_SHEET); + if (decl_list) { + _mergeDeclList(decl_list, SP_STYLE_SRC_STYLE_SHEET); + } } // Mostly for unit testing -- cgit v1.2.3