bio-routing / tflow2

Apache License 2.0
73 stars 7 forks source link

fixing crash in TreeNode.delete caused by TreeNode.minValueNode() returns always nil #24

Closed cedi closed 6 years ago

cedi commented 6 years ago

Fix the function TreeNode.minValueNode() which always returns nil

This would lead to a crash in TreeNode.delete at line 159, since minValueNode() always returned nil and then in line 159 to 161 we would have a nil-ptr access which would lead to a crash. Therefore i introduce this small fix that return the object itself in TreeNode.minValue() when there is no left element left.