Skip to content

Commit

Permalink
fix od_cache_summary in case of empty cache
Browse files Browse the repository at this point in the history
  • Loading branch information
alexkowa committed Apr 5, 2024
1 parent 5ba414f commit 7f872eb
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions R/od_cache.R
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
od_cache_summary <- function(server = "ext") {
cache_dir <- od_cache_path(server)
files <- dir(cache_dir, pattern = ".csv")
if(length(files)==0)
return(NULL)
pos_underscore <- as.integer(gregexpr("_C-", files))
is_field <- pos_underscore != -1
field <- substr(files[is_field], 1 + pos_underscore[is_field], nchar(files[is_field]) - 4)
Expand Down

0 comments on commit 7f872eb

Please sign in to comment.