Skip to content

Commit

Permalink
RChain: do not throw error when empty data is fetched (#3202)
Browse files Browse the repository at this point in the history
* RChain: do not throw error when empty data is fetched

* fixed typo

---------

Co-authored-by: Stefano Ricci <[email protected]>
  • Loading branch information
SteRiccio and SteRiccio authored Dec 19, 2023
1 parent 4f99cc3 commit 6f60cfe
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ arena.parseResponse = function(resp) {
resp <- httr::content(resp, as = "text")
respJson = jsonlite::fromJSON(resp)

# Check whether response containts error
# Check whether response contains error
respNames <- names(respJson)
error <- NA
if("error" %in% respNames){
Expand Down Expand Up @@ -35,7 +35,11 @@ arena.getToFile = function (url, query = NULL, file) {
arena.getCSV = function (url, query = NULL) {
tmp <- tempfile()
arena.getToFile(url, query, file = tmp)
content <- suppressWarnings(read.csv(tmp))
if (file.info(tmp)$size > 0) {
content <- suppressWarnings(read.csv(tmp))
} else {
content <- NULL
}
rm(tmp)
return(content)
}
Expand Down

0 comments on commit 6f60cfe

Please sign in to comment.