From 2cb2dcae3f16753cf829df9d3d893d403bb3b52a Mon Sep 17 00:00:00 2001 From: Maciej Ziarkowski Date: Wed, 21 Mar 2018 14:25:23 +0000 Subject: [PATCH] Fix error in safeLabel for formula label with empty data --- R/layers.R | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/R/layers.R b/R/layers.R index 1bead2d20..27997eca9 100644 --- a/R/layers.R +++ b/R/layers.R @@ -488,6 +488,11 @@ safeLabel <- function(label, data) { } label <- evalFormula(label, data) + + if(length(label) == 0) { + return(label) + } + if(! (inherits(label, "html") || sum(sapply(label,function(x){!inherits(x,'html')})) == 0)) { label <- htmltools::htmlEscape(label)