From 8fefdd084c9c8762b0f57e475f902d6f48fe8a9c Mon Sep 17 00:00:00 2001 From: Carson Date: Mon, 2 Oct 2023 14:04:58 -0500 Subject: [PATCH] isTruthy() should check for NULL before is.atomic() --- R/utils.R | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/R/utils.R b/R/utils.R index b54484bdeb..a741afe1f5 100644 --- a/R/utils.R +++ b/R/utils.R @@ -1243,11 +1243,12 @@ isTruthy <- function(x) { if (inherits(x, 'try-error')) return(FALSE) + if (is.null(x)) + return(FALSE) + if (!is.atomic(x)) return(TRUE) - if (is.null(x)) - return(FALSE) if (length(x) == 0) return(FALSE) if (all(is.na(x)))