Skip to content

#14739 Fix null pointer crash in intersection result text builders - #14740

Open
magnesj wants to merge 1 commit into
OPM:devfrom
magnesj:fix-14739-intersection-part-mgr-null
Open

#14739 Fix null pointer crash in intersection result text builders#14740
magnesj wants to merge 1 commit into
OPM:devfrom
magnesj:fix-14739-intersection-part-mgr-null

Conversation

@magnesj

@magnesj magnesj commented Sep 12, 2026

Copy link
Copy Markdown
Member

Fixes #14739

Problem
RiuResultTextBuilder::geometrySelectionText() and RiuFemResultTextBuilder::geometrySelectionText() checked m_2dIntersectionView for null but called m_2dIntersectionView->flatIntersectionPartMgr()->unflattenTransformMatrix(...) without checking that flatIntersectionPartMgr() itself is non-null. m_flatIntersectionPartMgr is only created in Rim2dIntersectionView::onCreateDisplayModel(). Result text can be requested via selection-change handling right after a new intersection is appended, before the display model (and part manager) is created, causing a null pointer dereference and crash.

Fix
Add a null check on flatIntersectionPartMgr() alongside the existing m_2dIntersectionView check in both result text builders.

Guard against a null flatIntersectionPartMgr() in RiuResultTextBuilder and RiuFemResultTextBuilder. The part manager is only created when the display model is built, but result text can be requested (via selection updates) before that happens, e.g. right after appending a new intersection.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Crash in result text builder when intersection part manager not yet created

1 participant