Skip to content

Commit f8d31e1

Browse files
committed
Fixed potential crash when reloading post model with plane cut active.
1 parent 4a9c309 commit f8d31e1

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

PostGL/GLPlaneCutPlot.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,8 +243,14 @@ void CGLPlaneCutPlot::Render(GLRenderEngine& re, GLContext& rc)
243243
// make sure we have a clip plane ID assigned
244244
if ((m_nclip == -1) || !IsActive()) return;
245245

246+
Post::CGLModel* mdl = GetModel();
247+
if ((mdl == nullptr) || !mdl->IsValid()) return;
248+
249+
Post::FEPostModel* fem = mdl->GetFSModel();
250+
if (fem == nullptr) return;
251+
246252
vec3d r = m_T.GetPosition();
247-
BOX box = GetModel()->GetFSModel()->GetBoundingBox();
253+
BOX box = fem->GetBoundingBox();
248254
m_T.SetPosition(-box.Center());
249255
m_T.SetRotation(quatd(0.0, vec3d(1, 0, 0)));
250256

0 commit comments

Comments
 (0)