From 381b41aa367855dad297bc42eee28403a0aa29b2 Mon Sep 17 00:00:00 2001 From: Michael Schubert Date: Wed, 13 Nov 2024 16:12:13 +0100 Subject: [PATCH] fix empty list formatting --- R/util.r | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/R/util.r b/R/util.r index ef75489..dcd6e5e 100644 --- a/R/util.r +++ b/R/util.r @@ -33,7 +33,8 @@ fill_template = function(template, values, required=c()) { upd = keys %in% names(values) is_num = sapply(values, is.numeric) - values[is_num] = format(values[is_num], scientific=FALSE, trim=TRUE) + if (length(is_num) > 0) + values[is_num] = format(values[is_num], scientific=FALSE, trim=TRUE) vals[upd] = unlist(values)[keys[upd]] if (any(is.na(vals))) stop("Template values required but not provided: ",