diff --git a/src/OpenFOAM/algorithms/indexedOctree/indexedOctree.C b/src/OpenFOAM/algorithms/indexedOctree/indexedOctree.C index 11c9d3be2a..541a008d6b 100644 --- a/src/OpenFOAM/algorithms/indexedOctree/indexedOctree.C +++ b/src/OpenFOAM/algorithms/indexedOctree/indexedOctree.C @@ -2476,7 +2476,7 @@ Foam::indexedOctree::indexedOctree while (true) { - compactContents + label nNodes = compactContents ( nodes, contents, @@ -2487,7 +2487,7 @@ Foam::indexedOctree::indexedOctree compactI ); - if (compactI == 0) + if (compactI == 0 && nNodes == 0) { // Did not put contents anywhere - are outside bb! break;