diff --git a/R/call.R b/R/call.R index c074d048b..1b0b4d7ed 100644 --- a/R/call.R +++ b/R/call.R @@ -67,13 +67,10 @@ renv_call_matches <- function(call, names, nargs = NULL) { ok <- FALSE - if (is.call(call)) { - if (is.symbol(sym <- call[[1L]])) { - if (any(names == as.character(sym))) { - ok <- is.null(nargs) || length(call) == nargs + 1L - } - } - } + if (is.call(call) && + is.symbol(sym <- call[[1L]]) && + any(names == as.character(sym))) + ok <- is.null(nargs) || length(call) == nargs + 1L ok diff --git a/R/dependencies.R b/R/dependencies.R index 32c6da04e..8d32c1252 100644 --- a/R/dependencies.R +++ b/R/dependencies.R @@ -1898,7 +1898,7 @@ renv_dependencies_recurse_impl <- function(stack, object, callback, ...) { # recurse if (is.recursive(object)) for (i in seq_along(object)) - if (!is.symbol(object[[i]])) + if (is.call(object[[i]])) renv_dependencies_recurse_impl(stack, object[[i]], callback, ...) }