Skip to content

Commit

Permalink
Fixed panic on import
Browse files Browse the repository at this point in the history
  • Loading branch information
= committed Apr 4, 2021
1 parent ab30f86 commit 4f226b0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion multitree/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ func (n *Node) GetByAlias(alias string) *Node {
// validateNewLink creates deep copies of the nodes' graphs, connects the copied
// nodes, and checks if the resulting graph is a valid multitree.
func validateNewLink(origin, dest *Node) error {
if origin.ID == 0 || dest.ID == 0 {
if origin.ID == 0 && dest.ID == 0 {
panic("link endpoints must have IDs")
}
if origin.HasChild(dest) != dest.HasParent(origin) {
Expand Down

0 comments on commit 4f226b0

Please sign in to comment.