Skip to content

Commit

Permalink
Return empty table if dependency metrics is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeff-Thompson12 committed Jan 18, 2024
1 parent 2b60e40 commit 8014bac
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions R/mod_reportPreview.R
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,9 @@ reportPreviewServer <- function(id, selected_pkg, maint_metrics, com_metrics,
dep_table <- eventReactive(dep_metrics(), {
req(dep_metrics())

if (nrow(dep_metrics()) == 0)
return(dplyr::tibble(package = character(), type = character(), version = character(), score = character()))

purrr::map_df(dep_metrics()$name, ~get_versnScore(.x, session$userData$loaded2_db(), session$userData$repo_pkgs())) %>%
right_join(dep_metrics(), by = "name") %>%
select(package, type, version, score) %>%
Expand Down

0 comments on commit 8014bac

Please sign in to comment.