diff --git a/app/src/main/java/ch/nuth/zhaw/exbox/AVLSearchTree.java b/app/src/main/java/ch/nuth/zhaw/exbox/AVLSearchTree.java index 34be94c..e6d6dc1 100644 --- a/app/src/main/java/ch/nuth/zhaw/exbox/AVLSearchTree.java +++ b/app/src/main/java/ch/nuth/zhaw/exbox/AVLSearchTree.java @@ -24,7 +24,11 @@ public class AVLSearchTree> extends SortedBinaryTree @Override protected int calcSize(TreeNode p) { - return super.calcSize(p) + p.values.size() - 1; + if (p == null) { + return 0; + } else { + return super.calcSize(p) + p.values.size() - 1; + } } /**