Skip to content

Commit 31601ba

Browse files
resolved bugs
1 parent 02945d6 commit 31601ba

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/test/java/com/thealgorithms/datastructures/trees/BinaryTreeTest.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,11 @@ class BinaryTreeTest {
4545
"Tree should have 2 nodes left after removals.");
4646

4747
// Check if new root is correct
48-
Assertions.assertEquals(9, root.data);
48+
if (root != null) {
49+
Assertions.assertEquals(9, root.data);
50+
} else {
51+
Assertions.fail("Root is null after removals.");
52+
}
4953
}
5054

5155
// Test for attempting to remove a nonexistent node

0 commit comments

Comments
 (0)