Skip to content

Commit

Permalink
prevent "NULL" user libpaths (#1162)
Browse files Browse the repository at this point in the history
In R CMD check for R >= 4.2, the environment variable R_LIBS_USER somehow gets set to the character NULL.

This is a bandaid for this. See #1161 (comment)
  • Loading branch information
zkamvar authored Mar 9, 2023
1 parent 31ae17a commit 028ccc5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/libpaths.R
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ renv_libpaths_user <- function() {
for (envvar in envvars) {

value <- Sys.getenv(envvar, unset = NA)
if (is.na(value) || value == "<NA>" || !nzchar(value))
if (is.na(value) || value == "<NA>" || value == "NULL" || !nzchar(value))
next

parts <- strsplit(value, .Platform$path.sep, fixed = TRUE)[[1]]
Expand Down

0 comments on commit 028ccc5

Please sign in to comment.