From be7783776c27aa2bd9b04ca1e65436d02e159f43 Mon Sep 17 00:00:00 2001 From: Kristian Bendiksen Date: Fri, 25 Mar 2022 15:26:37 +0100 Subject: [PATCH] #8362 Simulations wells: Fix crash on show spheres. --- .../ModelVisualization/RivWellSpheresPartMgr.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ApplicationLibCode/ModelVisualization/RivWellSpheresPartMgr.cpp b/ApplicationLibCode/ModelVisualization/RivWellSpheresPartMgr.cpp index d32765d161..a49143acdc 100644 --- a/ApplicationLibCode/ModelVisualization/RivWellSpheresPartMgr.cpp +++ b/ApplicationLibCode/ModelVisualization/RivWellSpheresPartMgr.cpp @@ -109,9 +109,11 @@ void RivWellSpheresPartMgr::appendDynamicGeometryPartsToModel( cvf::ModelBasicLi } } - cvf::ref part = createPart( centerColorPairs, wellResultFrame->m_isOpen ); - - model->addPart( part.p() ); + if ( !centerColorPairs.empty() ) + { + cvf::ref part = createPart( centerColorPairs, wellResultFrame->m_isOpen ); + model->addPart( part.p() ); + } } //--------------------------------------------------------------------------------------------------