From 6d7316c0011598d6cdafe9badb9830aaaf9749d6 Mon Sep 17 00:00:00 2001 From: Admin_asena5 Date: Tue, 2 Apr 2024 14:47:51 -0400 Subject: [PATCH] Handle case of empty table --- R/Database.R | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/R/Database.R b/R/Database.R index 311e192..6273eb9 100644 --- a/R/Database.R +++ b/R/Database.R @@ -359,7 +359,11 @@ exportDatabaseToCsv <- function( inds <- floor(countN/maxRowCount) tableAppend = F - pb = utils::txtProgressBar(min = 0, max = countN, initial = 0) + # NOTE: If the table has 0 rows (countN == 0), + # then setting the txtProgressBar will fail since + # min < max. So, setting max = countN+1 for this + # reason. + pb = utils::txtProgressBar(min = 0, max = countN+1, initial = 0) for(i in 1:length(inds)){