diff --git a/app/models/communication/extranet/with_style.rb b/app/models/communication/extranet/with_style.rb
index cb8709cd240056215c956adc11b3db969b296635..d4ccf9414c4304f0e6d67714215be41bddccf42c 100644
--- a/app/models/communication/extranet/with_style.rb
+++ b/app/models/communication/extranet/with_style.rb
@@ -8,6 +8,10 @@ module Communication::Extranet::WithStyle
   protected
 
   def generate_css
-    self.css = SassC::Engine.new(sass, syntax: :sass, style: :compressed).render
+    begin
+      self.css = SassC::Engine.new(sass, syntax: :sass, style: :compressed).render
+    rescue SassC::SyntaxError
+      errors.add(:sass, :invalid)
+    end
   end
 end
\ No newline at end of file