Collection Manager: Fix invalid list index. Task: T69577
Fix error when trying to add a new collection if the selected collection was deleted using the Outliner.
This commit is contained in:
parent
92cfcccf0c
commit
c673be0c38
|
@ -22,7 +22,7 @@ bl_info = {
|
|||
"name": "Collection Manager",
|
||||
"description": "Manage collections and their objects",
|
||||
"author": "Ryan Inch",
|
||||
"version": (2, 7, 23),
|
||||
"version": (2, 7, 24),
|
||||
"blender": (2, 80, 0),
|
||||
"location": "View3D - Object Mode (Shortcut - M)",
|
||||
"warning": '', # used for warning icon and text in addons panel
|
||||
|
|
|
@ -335,6 +335,10 @@ class CollectionManager(Operator):
|
|||
|
||||
self.view_layer = view_layer.name
|
||||
|
||||
# make sure list index is valid
|
||||
if cm.cm_list_index >= len(cm.cm_list_collection):
|
||||
cm.cm_list_index = -1
|
||||
|
||||
# check if expanded & history/buffer state still correct
|
||||
if collection_state:
|
||||
new_state = generate_state()
|
||||
|
|
Loading…
Reference in New Issue