From 4ea51e4e65ba1a333c8266f46d1e66de871fa204 Mon Sep 17 00:00:00 2001 From: Robrecht Cannoodt Date: Tue, 19 Sep 2023 06:20:18 +0200 Subject: [PATCH] also check whether ordered is null or not --- R/read_h5ad_helpers.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/read_h5ad_helpers.R b/R/read_h5ad_helpers.R index d27647e9..d1151363 100644 --- a/R/read_h5ad_helpers.R +++ b/R/read_h5ad_helpers.R @@ -297,7 +297,7 @@ read_h5ad_categorical <- function(file, name, version = "0.2.0") { attributes <- rhdf5::h5readAttributes(file, name) ordered <- attributes[["ordered"]] - if (is.na(ordered)) { + if (is.null(ordered) || is.na(ordered)) { # This version of {rhdf5} doesn't yet support ENUM type attributes so we # can't tell if the categorical should be ordered, # see https://github.com/grimbough/rhdf5/issues/125