From 6da41a4c5a060d7e2fec7f9e4849bc97a2360c07 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Wed, 28 May 2025 14:19:57 +0200 Subject: [PATCH] Add missing check for null pointer --- .../ProjectDataModel/Surfaces/RimFileSurface.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ApplicationLibCode/ProjectDataModel/Surfaces/RimFileSurface.cpp b/ApplicationLibCode/ProjectDataModel/Surfaces/RimFileSurface.cpp index d82e4cc451..d4e4faef74 100644 --- a/ApplicationLibCode/ProjectDataModel/Surfaces/RimFileSurface.cpp +++ b/ApplicationLibCode/ProjectDataModel/Surfaces/RimFileSurface.cpp @@ -120,11 +120,13 @@ void RimFileSurface::fieldChangedByUi( const caf::PdmFieldHandle* changedField, bool RimFileSurface::updateSurfaceData() { bool result = true; - if ( m_triangleMeshData->geometry().first.empty() ) + if ( !m_triangleMeshData || m_triangleMeshData->geometry().first.empty() ) { result = loadDataFromFile(); } + if ( !m_triangleMeshData ) return false; + auto [vertices, tringleIndices] = m_triangleMeshData->geometry(); auto surface = new RigSurface;