Skip to content

Commit 439c2f8

Browse files
handle null args case
1 parent f2f3bf6 commit 439c2f8

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

R/iidda.api/DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: iidda.api
22
Title: IIDDA API
3-
Version: 0.3.0
3+
Version: 0.3.1
44
Authors@R:
55
person("Steve", "Walker", , "swalk@mcmaster.ca", role = c("aut", "cre"))
66
Description: R Bindings for the IIDDA API.

R/iidda.api/R/parse.R

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
set_dict_names = function(x) setNames(x, vapply(x, getElement, character(1L), "name"))
1+
set_dict_names = function(x) {
2+
setNames(x, vapply(x, getElement, character(1L), "name"))
3+
}
24
get_dict = function() {
35
suppressWarnings({iidda.api::ops_staging$data_dictionary() |> set_dict_names()})
46
}

R/iidda.api/R/rapiclient.R

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,10 @@
66
arg_names <- arg_names[!arg_names %in% c("...", ".__body__")]
77
args <- mget(arg_names, environment)
88
expand_url_args = function(x) {
9-
if (is.null(x)) return(x) ## silence warning about passing NULL to structure
10-
structure(
11-
do.call(c, lapply(x, function(z) as.list(z)))
12-
, names = rep(names(x), sapply(x, length))
13-
)
9+
lst = do.call(c, lapply(x, function(z) as.list(z)))
10+
if (is.null(lst)) return(lst) ## silence warning about passing NULL to structure
11+
nmd_lst = structure(lst, names = rep(names(x), sapply(x, length)))
12+
return(nmd_lst)
1413
}
1514
expand_url_args(args)
1615
}

R/iidda.api/R/sysdata.rda

-30 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)