mirror of
https://projects.blender.org/blender/blender.git
synced 2025-01-22 07:22:12 -05:00
Fix: Variable referenced in UI code without being assigned
Mistake in d4d046a673
Right now python error is triggered with empty material slot.
Pull Request: https://projects.blender.org/blender/blender/pulls/133287
This commit is contained in:
parent
c749f6c376
commit
446b2a983d
1 changed files with 6 additions and 2 deletions
|
@ -46,8 +46,12 @@ class GPENCIL_UL_matslots(UIList):
|
|||
def draw_item(self, _context, layout, _data, item, icon, _active_data, _active_propname, _index):
|
||||
slot = item
|
||||
ma = slot.material
|
||||
if (ma is not None) and (ma.grease_pencil is not None):
|
||||
gpcolor = ma.grease_pencil
|
||||
|
||||
if ma is None:
|
||||
return
|
||||
|
||||
if (gpcolor := ma.grease_pencil) is None:
|
||||
return
|
||||
|
||||
if self.layout_type in {'DEFAULT', 'COMPACT'}:
|
||||
row = layout.row(align=True)
|
||||
|
|
Loading…
Reference in a new issue