diff --git a/mondrian/src/main/java/mondrian/util/PartiallyOrderedSet.java b/mondrian/src/main/java/mondrian/util/PartiallyOrderedSet.java index 5aea99c954..2e0d2b0664 100644 --- a/mondrian/src/main/java/mondrian/util/PartiallyOrderedSet.java +++ b/mondrian/src/main/java/mondrian/util/PartiallyOrderedSet.java @@ -4,7 +4,7 @@ * http://www.eclipse.org/legal/epl-v10.html. * You must accept the terms of that agreement to use this software. * -* Copyright (c) 2002-2017 Hitachi Vantara.. All rights reserved. +* Copyright (c) 2002-2019 Hitachi Vantara.. All rights reserved. */ package mondrian.util; @@ -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); }