added obj check #14

Merged
Nika Kutsniashvili merged 1 commits from AlaaCG/add_mesh_BoltFactory:obj-check into main 2024-09-19 15:15:28 +02:00
Contributor

this error prints a few times when right clicking or randomly when doing something the viewport When there are no objects in the scene with the addon enabled, it kept annoying me so here is a pull request

it ends with this:

path_to\Blender\4.2\extensions\blender_org\boltfactory\Boltfactory.py", line 477, in Bolt_contex_menu
if obj.data is not None and 'Bolt' in obj.data.keys():
^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'data'

it's really a simple, can be just fixed by checking if there is an object in the first place before trying to access it's data

in this case, adding "obj and" fixes it, hope this gets merged, Thanks

this error prints a few times when right clicking or randomly when doing something the viewport When there are no objects in the scene with the addon enabled, it kept annoying me so here is a pull request it ends with this: path_to\Blender\4.2\extensions\blender_org\boltfactory\Boltfactory.py", line 477, in Bolt_contex_menu if obj.data is not None and 'Bolt' in obj.data.keys(): ^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'data' it's really a simple, can be just fixed by checking if there is an object in the first place before trying to access it's data in this case, adding "obj and" fixes it, hope this gets merged, Thanks
AlaaCG added 1 commit 2024-09-15 07:40:36 +02:00
this error prints a few times when right clicking or randomly when doing something the viewport When there are no objects in the scene with the addon enabled, it kept annoying me so here is a pull request

it ends with this:

path_to\Blender\4.2\extensions\blender_org\boltfactory\Boltfactory.py", line 477, in Bolt_contex_menu
    if obj.data is not None and 'Bolt' in obj.data.keys():
       ^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'data'


it's really a simple, can be just fixed by checking if there is an object in the first place before trying to access it's data 

in this case, adding "obj and" fixes it, hope this gets merged, Thanks
First-time contributor

Hi
I've re-created this and tested the fix locally on Bender versions 4.2.1 LTS and 3.6.3.
Looks good in both cases.

Should there be an issue ticket raised to capture the documentation, both here and in the old AddOn area in case there is another release and it makes the back port list?

Hi I've re-created this and tested the fix locally on Bender versions 4.2.1 LTS and 3.6.3. Looks good in both cases. Should there be an issue ticket raised to capture the documentation, both here and in the old AddOn area in case there is another release and it makes the back port list?
Author
Contributor

I don't think so, it's just a very small error thus unnecessary

if you think it should be done please go ahead!

Thanks.

I don't think so, it's just a very small error thus unnecessary if you think it should be done please go ahead! Thanks.
Nika Kutsniashvili approved these changes 2024-09-19 15:15:17 +02:00
Nika Kutsniashvili left a comment
Owner

Thanks for the fix

Thanks for the fix
Nika Kutsniashvili merged commit 1d945a6aa6 into main 2024-09-19 15:15:28 +02:00
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
3 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/add_mesh_BoltFactory#14
No description provided.