diff --git a/mondrian/src/main/java/mondrian/util/PartiallyOrderedSet.java b/mondrian/src/main/java/mondrian/util/PartiallyOrderedSet.java index 5aea99c954..4b8868eb3b 100644 --- a/mondrian/src/main/java/mondrian/util/PartiallyOrderedSet.java +++ b/mondrian/src/main/java/mondrian/util/PartiallyOrderedSet.java @@ -652,12 +652,12 @@ private List descendants(E e, boolean up) { final List list = new ArrayList(); while (!deque.isEmpty()) { Node node1 = deque.pop(); + if(node1.e == null) { + // Node is top or bottom. + continue; + } list.add(node1.e); for (Node child : up ? node1.childList : node1.parentList) { - if (child.e == null) { - // Node is top or bottom. - break; - } if (seen.add(child)) { deque.add(child); }