Skip to content

Commit

Permalink
Materials: Catch NoneType bmat
Browse files Browse the repository at this point in the history
  • Loading branch information
loonaticx committed Jul 16, 2024
1 parent 11b7a2c commit e32fdbb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1479,8 +1479,8 @@ def add_polygon(self, context, prim, vpool):
# <bpy_struct, Material invalid> & getting a ReferenceError. Problem is that it will resolve as True
try:
bmat.id_data
except ReferenceError:
# StructRNA of type Material has been removed
except (ReferenceError, AttributeError):
# StructRNA of type Material has been removed (OR NoneType)
# Data still loosely exists but there is nothing we can do about it at this point.
bmat = None

Expand Down

0 comments on commit e32fdbb

Please sign in to comment.