From e8885065eac8fb2821c193a2c6e321306d1d39d2 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Fri, 14 Mar 2025 11:02:33 +0100 Subject: [PATCH] Guard null pointer use --- .../ExportCommands/RicSnapshotAllViewsToFileFeature.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ApplicationLibCode/Commands/ExportCommands/RicSnapshotAllViewsToFileFeature.cpp b/ApplicationLibCode/Commands/ExportCommands/RicSnapshotAllViewsToFileFeature.cpp index 057b320bd1..80bc128e7a 100644 --- a/ApplicationLibCode/Commands/ExportCommands/RicSnapshotAllViewsToFileFeature.cpp +++ b/ApplicationLibCode/Commands/ExportCommands/RicSnapshotAllViewsToFileFeature.cpp @@ -114,9 +114,11 @@ void RicSnapshotAllViewsToFileFeature::exportSnapshotOfViewsIntoFolder( const QS for ( auto riv : viewsForSnapshot ) { + RiuViewer* viewer = riv->viewer(); + if ( !viewer ) continue; + RiaApplication::instance()->setActiveReservoirView( riv ); - RiuViewer* viewer = riv->viewer(); Riu3DMainWindowTools::setActiveViewer( viewer->layoutWidget() ); RiaViewRedrawScheduler::instance()->clearViewsScheduledForUpdate();