Skip to content

Commit

Permalink
Catch LESS compile exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
gregpriday committed Jan 14, 2016
1 parent 5ae5ec0 commit 84dd81f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion base/siteorigin-widget.class.php
Expand Up @@ -626,7 +626,12 @@ public function get_instance_css( $instance ){
$lc_functions = new SiteOrigin_Widgets_Less_Functions($this, $instance);
$lc_functions->registerFunctions($c);

$css = $c->compile( $less );
try {
$css = $c->compile( $less );
}
catch ( Exception $e ) {
$css = '';
}

// Remove any attributes with default as the value
$css = preg_replace('/[a-zA-Z\-]+ *: *default *;/', '', $css);
Expand Down

0 comments on commit 84dd81f

Please sign in to comment.