From 14821996c51bb5e8bbe20ea964c7b500b476762f Mon Sep 17 00:00:00 2001 From: Luke Winslow Date: Wed, 30 Dec 2015 12:04:01 -0600 Subject: [PATCH] dealing with issue #52 --- R/item_file_download.R | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/R/item_file_download.R b/R/item_file_download.R index 8690ada..2fa700c 100644 --- a/R/item_file_download.R +++ b/R/item_file_download.R @@ -52,7 +52,7 @@ item_file_download = function(id, ..., names, destinations, dest_dir, session=cu destinations = file.path(dest_dir, names) #or we have names and destinations - }else{ + }else if(!missing(names) & !missing(destinations)){ if(length(names) != length(destinations)){ stop('Length of names and destinations must be identical') } @@ -62,6 +62,9 @@ item_file_download = function(id, ..., names, destinations, dest_dir, session=cu if(!all(names %in% flist$fname)){ stop('Item does not contain all requested files') } + #otherwise in some other error condition + }else{ + stop('Must have either names & destinations, or dest_dir for all files') }