diff --git a/R/ConfigurationFunctions.R b/R/ConfigurationFunctions.R index f1884143..7c0d75bd 100644 --- a/R/ConfigurationFunctions.R +++ b/R/ConfigurationFunctions.R @@ -24,6 +24,10 @@ getConfiguration <- function(configname, configtype, configpaths = NULL, pkg="us } } config <- configr::read.config(configpath) + if (typeof(config) == "logical" && config == FALSE) { + logging::logwarn(paste0("Configuration not found for ", configname)) + return(NULL) + } return(config) } diff --git a/R/InitializeModel.R b/R/InitializeModel.R index 13be230e..56fa11f1 100644 --- a/R/InitializeModel.R +++ b/R/InitializeModel.R @@ -9,7 +9,7 @@ initializeModel <- function(modelname, configpaths = NULL) { model <- list() # Get model specs model$specs <- getConfiguration(modelname, "model", configpaths) - if (rlang::is_na(model$specs)) { + if (is.null(model$specs)) { stop(paste("No configuration exists for a model named", modelname)) } else { # Get model crosswalk