diff --git a/R/condition.R b/R/condition.R index 53699ab..3ee38e0 100644 --- a/R/condition.R +++ b/R/condition.R @@ -42,7 +42,8 @@ new_condition <- function( # nolint cyclocomp_linter, if (!length(class) == 1L && !is.character(class)) { stop(cond_new_conditional_class()) } - + + force(package) type <- as.character(type) type <- match.arg(type) class <- as.character(class) @@ -109,7 +110,7 @@ cond_new_conditional_pkg <- function() { ) } -package <- function(env = parent.frame()) { +package <- function(env = parent.frame(2L)) { top <- topenv(env) if (isNamespace(top)) { unname(getNamespaceName(top))