diff --git a/R/glue.R b/R/glue.R index 0a7693c..2b97ffc 100644 --- a/R/glue.R +++ b/R/glue.R @@ -97,6 +97,7 @@ glue_data <- function(.x, ..., .sep = "", .envir = parent.frame(), # Perform all evaluations in a temporary environment if (is.null(.x)) { + stopifnot(is.environment(.envir)) parent_env <- .envir } else if (is.environment(.x)) { parent_env <- .x