diff --git a/elki-clustering/src/main/java/elki/index/tree/betula/CFNode.java b/elki-clustering/src/main/java/elki/index/tree/betula/CFNode.java
index <HASH>..<HASH> 100644
--- a/elki-clustering/src/main/java/elki/index/tree/betula/CFNode.java
+++ b/elki-clustering/src/main/java/elki/index/tree/betula/CFNode.java
@@ -91,8 +91,13 @@ public class CFNode<L extends ClusterFeature> implements AsClusterFeature {
    * @return CF
    */
   public AsClusterFeature getChild(int i) {
+    if(i < children.length) {
     return (AsClusterFeature) children[i];
   }
+  else {
+    return null;
+  }
+  }
 
   /**
    * Add a subtree
fix array out of bounds exeption