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

1 Commits

Author SHA1 Message Date
5bbcc3d783 added obj check
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
2024-09-15 07:39:51 +02:00