Fix [#22249] Can enter camera view when there is no camera in scene
authorMatt Ebb <matt@mke3.net>
Thu, 6 May 2010 03:49:26 +0000 (03:49 +0000)
committerMatt Ebb <matt@mke3.net>
Thu, 6 May 2010 03:49:26 +0000 (03:49 +0000)
source/blender/editors/space_view3d/view3d_edit.c

index c7a174626a0ff084b7595f4283424b24d7d90433..3d039f07a65cbb15b1a6d01710319e113757dff0 100644 (file)
@@ -1893,7 +1893,8 @@ static int viewnumpad_exec(bContext *C, wmOperator *op)
 
                                        if(v3d->camera==NULL) {
                                                v3d->camera= scene_find_camera(scene);
-                                               /*handle_view3d_lock();*/
+                                               if (v3d->camera == NULL)
+                                                       return OPERATOR_CANCELLED;
                                        }
                                        rv3d->persp= RV3D_CAMOB;
                                        smooth_view(C, NULL, v3d->camera, rv3d->ofs, rv3d->viewquat, &rv3d->dist, &v3d->lens);