mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-27 07:30:20 -05:00
Guard against null case and view when painting overlay and creating intersections
Four crashes reported from release builds share the same shape: a pointer that is null during teardown or before a view is fully created is dereferenced without a check. RiuViewer::paintOverlayItems() used the owner case of the view and of the comparison view without checking it, and dereferenced the result of a dynamic_cast directly. The owner case is null while a case is being closed. RicIntersectionFeatureImpl::createIntersectionBoxSlize() checked activeMainOrComparisonGridView() but dereferenced activeGridView(), which is a different object and can be null or have no viewer. RimEclipseContourMapView::onCreateDisplayModel() called viewer()->mainCamera() before the viewer exists. RimCorrelationPlotCollection::applyFirstEnsembleFieldAddressesToPlot() called front() on the ensemble parameter vector, which is empty for an ensemble without realization parameters.
This commit is contained in:
1 parent
842520c5e9
commit
593f27dcf4
4 files changed
+14
-8
No files matched your search
@@ -210,7 +210,7 @@ void RimEclipseContourMapView::onCreateDisplayModel()
|
||||
updateGeometry();
|
||||
}
|
||||
|
||||
if ( viewer()->mainCamera()->viewMatrix() == sm_defaultViewMatrix )
|
||||
if ( viewer() && viewer()->mainCamera() && viewer()->mainCamera()->viewMatrix() == sm_defaultViewMatrix )
|
||||
{
|
||||
zoomAll();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user