Skip to content

Commit

Permalink
Fix. It failed when repos table was NULL.
Browse files Browse the repository at this point in the history
  • Loading branch information
maciekbanas committed Sep 26, 2023
1 parent 40066e2 commit ca370be
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions R/GitHost.R
Original file line number Diff line number Diff line change
Expand Up @@ -336,16 +336,18 @@ GitHost <- R6::R6Class("GitHost",

# add do repos table `api_url` column
add_repo_api_url = function(repos_table){
repos_table <- if (private$host == "GitHub") {
dplyr::mutate(
repos_table,
api_url = paste0(private$api_url, "/repos/", organization, "/", name),
)
} else if (private$host == "GitLab") {
dplyr::mutate(
repos_table,
api_url = paste0(private$api_url, "/projects/", gsub("gid://gitlab/Project/", "", id))
)
if (length(repos_table) > 0) {
repos_table <- if (private$host == "GitHub") {
dplyr::mutate(
repos_table,
api_url = paste0(private$api_url, "/repos/", organization, "/", name),
)
} else if (private$host == "GitLab") {
dplyr::mutate(
repos_table,
api_url = paste0(private$api_url, "/projects/", gsub("gid://gitlab/Project/", "", id))
)
}
}
return(repos_table)
},
Expand Down

0 comments on commit ca370be

Please sign in to comment.