Skip to content

Commit

Permalink
😓 return NULL when no email address is stored in .Renviron
Browse files Browse the repository at this point in the history
  • Loading branch information
njahn82 committed Oct 19, 2017
1 parent aaab00f commit d5e34dd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 0 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ addons:
packages:
- poppler-utils

before_install:
- mkdir -p ~/Rlib
- echo 'crossref_email = name@example.com' > .Renviron

r_github_packages:
- jimhester/covr

Expand Down
4 changes: 3 additions & 1 deletion R/zzz.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ cr_GET <- function(endpoint, args, todf = TRUE, on_error = warning, parse = TRUE
url <- sprintf("https://api.crossref.org/%s", endpoint)
cli <- crul::HttpClient$new(
url = url,
opts = list(verbose = TRUE),
headers = list(
`User-Agent` = rcrossref_ua(),
`X-USER-AGENT` = rcrossref_ua()
Expand Down Expand Up @@ -165,8 +166,9 @@ get_email <- function() {
email <- Sys.getenv("crossref_email")
if (identical(email, "")) {
NULL
}
} else {
paste0("(mailto:", val_email(email), ")")
}
}

#' Email checker
Expand Down

0 comments on commit d5e34dd

Please sign in to comment.