diff --git a/src/OpenFOAM/algorithms/indexedOctree/indexedOctree.C b/src/OpenFOAM/algorithms/indexedOctree/indexedOctree.C index ada7d06b5b..64346e1d25 100644 --- a/src/OpenFOAM/algorithms/indexedOctree/indexedOctree.C +++ b/src/OpenFOAM/algorithms/indexedOctree/indexedOctree.C @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation - \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd. + \\/ M anipulation | Copyright (C) 2016-2018 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -2560,6 +2560,11 @@ Foam::labelBits Foam::indexedOctree::findNode template Foam::label Foam::indexedOctree::findInside(const point& sample) const { + if (nodes_.empty()) + { + return -1; + } + labelBits index = findNode(0, sample); const node& nod = nodes_[getNode(index)]; @@ -2592,6 +2597,11 @@ const Foam::labelList& Foam::indexedOctree::findIndices const point& sample ) const { + if (nodes_.empty()) + { + return emptyList