[Bf-blender-cvs] [aa06be9148a] blender-v2.93-release: Fix error calling select-camera without a 3D view

Campbell Barton noreply at git.blender.org
Tue May 18 11:59:10 CEST 2021


Commit: aa06be9148a3a75cf117454a8009d90bdc4541d9
Author: Campbell Barton
Date:   Tue May 18 19:58:11 2021 +1000
Branches: blender-v2.93-release
https://developer.blender.org/rBaa06be9148a3a75cf117454a8009d90bdc4541d9

Fix error calling select-camera without a 3D view

===================================================================

M	release/scripts/startup/bl_operators/object.py

===================================================================

diff --git a/release/scripts/startup/bl_operators/object.py b/release/scripts/startup/bl_operators/object.py
index 5a388047ddd..d61bed71cab 100644
--- a/release/scripts/startup/bl_operators/object.py
+++ b/release/scripts/startup/bl_operators/object.py
@@ -133,7 +133,7 @@ class SelectCamera(Operator):
         scene = context.scene
         view_layer = context.view_layer
         view = context.space_data
-        if view.type == 'VIEW_3D' and view.use_local_camera:
+        if view and view.type == 'VIEW_3D' and view.use_local_camera:
             camera = view.camera
         else:
             camera = scene.camera



More information about the Bf-blender-cvs mailing list