Skip to content

Commit

Permalink
Cast to list before assigning config data
Browse files Browse the repository at this point in the history
  • Loading branch information
wlandau-lilly committed Apr 25, 2021
1 parent 88e2c7f commit 9214b09
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion R/class_config.R
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,14 @@ config_class <- R6::R6Class(
self$data[[name]]
},
set_value = function(name, value) {
assert_chr(name, "config name field must be a character.")
assert_scalar(name, "config name field must have length 1.")
assert_nzchar(name, "config name field must be nonempty.")
assert_chr(name, "config name field must be a character.")
if (self$is_locked()) {
return()
}
self$ensure()
self$data <- as.list(self$data)
self$data[[name]] <- value
self$write()
},
Expand Down

0 comments on commit 9214b09

Please sign in to comment.