File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -114,18 +114,21 @@ set_style_transformers <- function() {
114114 " Enter the name of a style transformer, e.g. `styler::tidyverse_style()`" ,
115115 current_style
116116 )
117- parsed_new_style <- with_handlers({
118- transformers <- eval(parse(text = new_style ))
119- style_text(c(" a = 2" , " function() {" , " NULL" , " }" ))
117+ if (! is.null(new_style )) {
118+ parsed_new_style <- with_handlers({
119+ transformers <- eval(parse(text = new_style ))
120+ style_text(c(" a = 2" , " function() {" , " NULL" , " }" ))
120121 },
121122 error = function (e ) {
122123 abort(paste0(
123124 " The selected style transformers \" " ,
124125 new_style , " \" is not valid: " , e $ message
125126 ))
126127 }
127- )
128- options(styler.addins_style_transformer = new_style )
128+ )
129+ options(styler.addins_style_transformer = new_style )
130+ }
131+
129132 invisible (current_style )
130133}
131134
You can’t perform that action at this time.
0 commit comments