Fix console errors from UI when no object is selected #1

Closed
Andrej wants to merge 1 commits from Andrej730/curve_tools:fix-ui-console-error into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
First-time contributor
  1. Default Blender scene.
  2. Ensure no object is active (if some object is active, just remove it).
  3. RMB on viewport to bring context menu.
  4. See the console errors.
Example error:
Traceback (most recent call last):
  File "\Blender\4.2\scripts\modules\bpy_types.py", line 1034, in draw_ls
    func(self, context)
  File "\Blender\4.2\extensions\blender_org\curve_tools\__init__.py", line 481, in curve_tools_object_context_menu
    if context.active_object.type == "CURVE":
       ^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'type'
1. Default Blender scene. 2. Ensure no object is active (if some object is active, just remove it). 3. RMB on viewport to bring context menu. 4. See the console errors. ``` Example error: Traceback (most recent call last): File "\Blender\4.2\scripts\modules\bpy_types.py", line 1034, in draw_ls func(self, context) File "\Blender\4.2\extensions\blender_org\curve_tools\__init__.py", line 481, in curve_tools_object_context_menu if context.active_object.type == "CURVE": ^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'type' ```
Andrej added 1 commit 2024-10-25 15:06:07 +02:00
Example error:
Traceback (most recent call last):
  File "\Blender\4.2\scripts\modules\bpy_types.py", line 1034, in draw_ls
    func(self, context)
  File "\Blender\4.2\extensions\blender_org\curve_tools\__init__.py", line 481, in curve_tools_object_context_menu
    if context.active_object.type == "CURVE":
       ^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'type'
Andrej requested review from Campbell Barton 2024-10-25 15:06:15 +02:00
Andrej requested review from Moderators 2024-10-25 15:06:56 +02:00
Campbell Barton approved these changes 2024-10-26 12:58:49 +02:00

Committed 42da3ab400

Committed 42da3ab40093f654ff65ad33a0e0576f448bbd37
Campbell Barton closed this pull request 2024-10-26 13:02:50 +02:00

Pull request closed

Sign in to join this conversation.
No reviewers
extensions/Moderators
No Label
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: extensions/curve_tools#1
No description provided.