Skip to content

Commit

Permalink
Handle empty files
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Solymos <psolymos@gmail.com>
  • Loading branch information
psolymos committed Jun 3, 2023
1 parent 7fb7b57 commit 62134d1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions R/parsers.R
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ parse_file <- function(x, ...) {
"json" = parse_json(x, ...),
"ini" = parse_ini(x, ...),
"txt" = parse_txt(x, ...))
if (is.null(out))
return(NULL)
attr(out, "trace") <- list(
kind = "file",
value = x)
Expand All @@ -141,6 +143,8 @@ parse_default <- function(...) {
if (!file.exists(f))
return(NULL)
l <- parse_file(f, ...)
if (is.null(l))
return(NULL)
attr(l, "trace") <- list(
kind = "file",
value = f)
Expand Down

0 comments on commit 62134d1

Please sign in to comment.