Fix T48262: Crash when trying to render a scene without camera.

This commit is contained in:
Bastien Montagne 2016-05-06 21:41:56 +02:00
parent e074554f8f
commit 8c2cec937b
Notes: blender-bot 2023-02-14 07:57:15 +01:00
Referenced by issue #48262,  Crash when trying to render a scene without camera.
2 changed files with 2 additions and 2 deletions

View File

@ -904,7 +904,7 @@ static Object *camera_multiview_advanced(Scene *scene, Object *camera, const cha
/* returns the camera to be used for render */
Object *BKE_camera_multiview_render(Scene *scene, Object *camera, const char *viewname)
{
const bool is_multiview = (scene->r.scemode & R_MULTIVIEW) != 0;
const bool is_multiview = (camera != NULL) && (scene->r.scemode & R_MULTIVIEW) != 0;
if (!is_multiview) {
return camera;

View File

@ -2860,7 +2860,7 @@ static bool check_valid_camera_multiview(Scene *scene, Object *camera, ReportLis
SceneRenderView *srv;
bool active_view = false;
if ((scene->r.scemode & R_MULTIVIEW) == 0)
if (camera == NULL || (scene->r.scemode & R_MULTIVIEW) == 0)
return true;
for (srv = scene->r.views.first; srv; srv = srv->next) {