From 84e0b4ebf1b1c129bd73aca5db6fffaac255c65f Mon Sep 17 00:00:00 2001 From: Garrick Aden-Buie Date: Thu, 15 Aug 2024 11:26:26 -0700 Subject: [PATCH] fix(format.packages_info): Handle no packages case --- R/package-info.R | 3 +++ 1 file changed, 3 insertions(+) diff --git a/R/package-info.R b/R/package-info.R index 37d9af7..7a546fe 100644 --- a/R/package-info.R +++ b/R/package-info.R @@ -227,6 +227,9 @@ abbrev_long_sha <- function(x) { #' @export format.packages_info <- function(x, ...) { + if (nrow(x) == 0) { + return(cli::col_grey("No packages.")) + } unloaded <- is.na(x$loadedversion) flib <- function(x) ifelse(is.na(x), "?", as.integer(x))