Skip to content

Commit

Permalink
error checking in catmaid_get_connectors_between
Browse files Browse the repository at this point in the history
* see issue #76
  • Loading branch information
jefferis committed Apr 28, 2017
1 parent 52e80d9 commit fd92798
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions R/catmaid_skeleton.R
Original file line number Diff line number Diff line change
Expand Up @@ -412,9 +412,20 @@ catmaid_get_treenode_table<-function(skid, pid=1, conn=NULL, raw=FALSE, ...) {
catmaid_get_connectors_between <- function(pre_skids=NULL, post_skids=NULL,
pid=1, conn=NULL, raw=FALSE, ...) {
post_data=list()
if(is.null(post_skids) && is.null(pre_skids))
stop("pre_skids and post_skids cannot both be null!")

if(!is.null(pre_skids)){
pre_skids=catmaid_skids(pre_skids, conn = conn, pid=pid)
post_data[sprintf("pre[%d]", seq(from=0, along.with=pre_skids))]=as.list(pre_skids)
} else {
cvn = catmaid_version(numeric = TRUE)
if (cvn < "2017.04.20" && cvn >= "2016.08.09")
stop(
"catmaid_get_connectors_between is buggy for CATMAID server version",
cvn,
"when no pre_skids are specified"
)
}
if(!is.null(post_skids)){
post_skids=catmaid_skids(post_skids, conn = conn, pid=pid)
Expand Down

0 comments on commit fd92798

Please sign in to comment.