Skip to content

Commit

Permalink
Print message - add extra check whether key is empty (#115)
Browse files Browse the repository at this point in the history
* add extra check whether key is empty

* Update R/AbstractAnnData.R

* fix bug introduced in refactoring

---------

Co-authored-by: Robrecht Cannoodt <[email protected]>
  • Loading branch information
csangara and rcannood authored Sep 19, 2023
1 parent 23fc791 commit 9eb2ebd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion R/AbstractAnnData.R
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,10 @@ AbstractAnnData <- R6::R6Class("AbstractAnnData", # nolint
)) {
attr_key <- paste0(attribute, "_keys")
if (!is.null(self[[attr_key]])) {
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 = "")
}
}
}
},
Expand Down

0 comments on commit 9eb2ebd

Please sign in to comment.