Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closes #211 -- handle missing input consistently #261

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Closes #211 -- handle missing input consistently
Michael Chirico committed Oct 16, 2018

Verified

This commit was signed with the committer’s verified signature. The key has expired.
addaleax Anna Henningsen
commit 7e41e303d3cccd6b982e69057f4c112f7817d80b
2 changes: 2 additions & 0 deletions R/fromJSON.R
Original file line number Diff line number Diff line change
@@ -77,6 +77,8 @@
fromJSON <- function(txt, simplifyVector = TRUE, simplifyDataFrame = simplifyVector,
simplifyMatrix = simplifyVector, flatten = FALSE, ...) {

# empty JSON -> empty data.frame
if (is.na(txt) || is.null(txt)) return(data.frame(NULL))
# check type
if (!is.character(txt) && !inherits(txt, "connection")) {
stop("Argument 'txt' must be a JSON string, URL or file.")