From 663524d652c6c545a3531016187c515ac2a42781 Mon Sep 17 00:00:00 2001 From: Robrecht Cannoodt Date: Tue, 19 Sep 2023 12:47:40 +0200 Subject: [PATCH] Update R/AbstractAnnData.R --- R/AbstractAnnData.R | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/R/AbstractAnnData.R b/R/AbstractAnnData.R index d98a96a5..6e1eab67 100644 --- a/R/AbstractAnnData.R +++ b/R/AbstractAnnData.R @@ -71,8 +71,9 @@ AbstractAnnData <- R6::R6Class("AbstractAnnData", # nolint )) { attr_key <- paste0(attribute, "_keys") if (!is.null(self[[attr_key]])) { - if (length(self[[attr_key]]()) > 0) { - cat(" ", pretty_print(attribute, self[[attr_key]]()), "\n", sep = "") + slot_keys <- self[[attr_key]]() + if (length(slot_keys) > 0) { + cat(" ", pretty_print(attribute, slot_keys, "\n", sep = "") } } }