diff --git a/src/OpenFOAM/algorithms/indexedOctree/indexedOctree.C b/src/OpenFOAM/algorithms/indexedOctree/indexedOctree.C index 38ccae1243..11c9d3be2a 100644 --- a/src/OpenFOAM/algorithms/indexedOctree/indexedOctree.C +++ b/src/OpenFOAM/algorithms/indexedOctree/indexedOctree.C @@ -2487,6 +2487,12 @@ Foam::indexedOctree::indexedOctree compactI ); + if (compactI == 0) + { + // Did not put contents anywhere - are outside bb! + break; + } + if (compactI == contents_.size()) { // Transferred all contents to contents_ (in order breadth first)