Skip to content

Commit b8923e9

Browse files
authored
Address r-devel's change in is.atomic(NULL) behavior (#3908)
1 parent 9ebcbf8 commit b8923e9

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

NEWS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212

1313
* Fixed #3898: `wrapFunctionLabel()` no longer throws an error if the `name` is longer than 10000 bytes. (#3903)
1414

15+
* On r-devel (R > 4.3.1), `isTruthy(NULL)` now returns `FALSE` (as it does with older versions of R). (#3906)
16+
1517
# shiny 1.7.5
1618

1719
## Possibly breaking changes

R/utils.R

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1240,14 +1240,12 @@ dotloop <- function(fun_, ...) {
12401240
#' @param x An expression whose truthiness value we want to determine
12411241
#' @export
12421242
isTruthy <- function(x) {
1243+
if (is.null(x))
1244+
return(FALSE)
12431245
if (inherits(x, 'try-error'))
12441246
return(FALSE)
1245-
12461247
if (!is.atomic(x))
12471248
return(TRUE)
1248-
1249-
if (is.null(x))
1250-
return(FALSE)
12511249
if (length(x) == 0)
12521250
return(FALSE)
12531251
if (all(is.na(x)))

tests/testthat/test-tabPanel.R

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ expect_snapshot2 <- function(...) {
1818
if (getRversion() < "3.6.0") {
1919
skip("Skipping snapshots on R < 3.6 because of different RNG method")
2020
}
21+
if (packageVersion("htmltools") <= "0.5.6" && getRversion() > "4.3.1") {
22+
skip("Skipping snapshots since htmltools is 'outdated'")
23+
}
2124
expect_snapshot(...)
2225
}
2326

0 commit comments

Comments
 (0)