Fix T57130: Crash when running 'set active object as camera' on an empty

Reviewed By: brecht

https://developer.blender.org/D3782
This commit is contained in:
Philipp Oeser 2018-10-10 14:30:44 +02:00
parent 84cf670d1d
commit 1fad887d9e
Notes: blender-bot 2023-02-14 07:39:46 +01:00
Referenced by issue #57130, Crash when running 'set active object as camera' on an empty
1 changed files with 1 additions and 1 deletions

View File

@ -634,7 +634,7 @@ static void OBJECT_engine_init(void *vedata)
}
float dist;
if (rv3d->persp == RV3D_CAMOB && v3d->camera) {
if (rv3d->persp == RV3D_CAMOB && v3d->camera && v3d->camera->type == OB_CAMERA) {
Object *camera_object = DEG_get_evaluated_object(draw_ctx->depsgraph, v3d->camera);
dist = ((Camera *)(camera_object->data))->clipend;
}