Fix T82596: Fly/walk navigation crash

Add a NULL check for the View3D's camera, because these
modes can be entered even without an active camera.
This commit is contained in:
Hans Goudey 2020-11-12 17:06:57 -05:00
parent 55e2930c18
commit cd49afc596
Notes: blender-bot 2023-02-14 09:48:25 +01:00
Referenced by issue #82596, fly/walk navigation crash
1 changed files with 2 additions and 1 deletions

View File

@ -138,7 +138,8 @@ struct View3DCameraControl *ED_view3d_cameracontrol_acquire(Depsgraph *depsgraph
vctrl->ctx_v3d = v3d;
vctrl->ctx_rv3d = rv3d;
vctrl->use_parent_root = v3d->camera->transflag & OB_TRANSFORM_ADJUST_ROOT_PARENT_FOR_VIEW_LOCK;
vctrl->use_parent_root = v3d->camera != NULL &&
v3d->camera->transflag & OB_TRANSFORM_ADJUST_ROOT_PARENT_FOR_VIEW_LOCK;
vctrl->persp_backup = rv3d->persp;
vctrl->dist_backup = rv3d->dist;