Skip to content

Commit

Permalink
fix another case of poor use of isValidEdgeList
Browse files Browse the repository at this point in the history
  • Loading branch information
d-callan committed Jan 30, 2024
1 parent f296876 commit ae844fb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
4 changes: 2 additions & 2 deletions R/constructors-Node.R
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ setMethod("NodeIdList", "character", function(object, uniquifyIds = c(TRUE, FALS

#' @export
setMethod("NodeIdList", "data.frame", function(object, uniquifyIds = c(TRUE, FALSE)) {
if (!isValidEdgeList(object)) {
stop(paste(errors, collapse = '\n'))
if (!inherits(isValidEdgeList(object), "logical")) {
stop(paste("Invalid edgeList:", isValidEdgeList(object), collapse = '\n'))
}

return(NodeIdList(c(object$source, object$target), uniquifyIds = uniquifyIds))
Expand Down
1 change: 0 additions & 1 deletion tests/testthat/test-nodes.R
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ test_that("NodeList methods work", {
test_that("We cannot make nonsensical nodes", {

expect_error(Node(id = FALSE))
#expect_error(Node(id = 10)) # why is this nonsensical?
expect_error(Node(id = 'A', color = FALSE))
expect_error(Node(id = 'A', weight = '10'))
})
Expand Down

0 comments on commit ae844fb

Please sign in to comment.