Skip to content

Commit 4bf3d05

Browse files
author
ripley
committed
further improvements to error reporting
git-svn-id: https://svn.r-project.org/R/trunk@87789 00db46b3-68df-0310-9c12-caf00c1e9a41
1 parent 333885d commit 4bf3d05

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/library/base/R/unlist.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
unlist <- function(x, recursive=TRUE, use.names=TRUE)
2020
{
2121
## for better error messages (islistfactor is not viisble)
22-
if(length(recursive) > 1L) stop("'recursive' must be of length 1")
22+
if(length(recursive) != 1L) stop("'recursive' must be of length 1")
23+
if(is.na(recursive)) stop("'recursive' is NA")
2324
if(.Internal(islistfactor(x, recursive))) {
2425
URapply <-
2526
if(recursive) # use rapply()

0 commit comments

Comments
 (0)