Skip to content

Commit 8230c30

Browse files
authored
Merge pull request #117 from ropensci-review-tools/pr-data
fix gh-pr-data when no author
2 parents 4bf3a80 + 73c1108 commit 8230c30

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

DESCRIPTION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: repometrics
22
Title: Metrics for Your Code Repository
3-
Version: 0.1.6.062
3+
Version: 0.1.6.063
44
Authors@R:
55
person("Mark", "Padgham", , "mark.padgham@email.com", role = c("aut", "cre"),
66
comment = c(ORCID = "0000-0003-2172-5265"))

R/data-gh-prs.R

+6-3
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,9 @@ rm_data_prs_from_gh_api_internal <- function (path, n_per_page = 30L) { # nolint
158158
character (1L)
159159
)
160160
author <- vapply (
161-
i$comments$nodes,
162-
function (j) j$author$login,
161+
i$comments$nodes, function (j) {
162+
ifelse (length (j$author) == 0L, "", j$author$login)
163+
},
163164
character (1L)
164165
)
165166
body <- vapply (i$comments$nodes, function (j) j$body, character (1L))
@@ -224,7 +225,9 @@ rm_data_prs_from_gh_api_internal <- function (path, n_per_page = 30L) { # nolint
224225
})
225226

226227
# A few extra pro-processing ones just to avoid long lines:
227-
user_login <- vapply (pr_data, function (i) i$author$login, character (1L))
228+
user_login <- vapply (pr_data, function (i) {
229+
ifelse (length (i$author) == 0L, "", i$author$login)
230+
}, character (1L))
228231
merged_by <- vapply (
229232
pr_data,
230233
function (i) null2na_char (i$mergedBy$login),

codemeta.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"codeRepository": "https://github.com/ropensci-review-tools/repometrics",
99
"issueTracker": "https://github.com/ropensci-review-tools/repometrics/issues",
1010
"license": "https://spdx.org/licenses/GPL-3.0",
11-
"version": "0.1.6.062",
11+
"version": "0.1.6.063",
1212
"programmingLanguage": {
1313
"@type": "ComputerLanguage",
1414
"name": "R",

0 commit comments

Comments
 (0)