diff options
author | Ryan Inch <mythologylover75@gmail.com> | 2020-05-23 08:12:36 +0300 |
---|---|---|
committer | Ryan Inch <mythologylover75@gmail.com> | 2020-05-23 08:12:36 +0300 |
commit | c673be0c38021b1b530868e6e88a365cfc8a4d39 (patch) | |
tree | a7b3bb3beba6f8a89482fb1476933c3b3609a30c | |
parent | 92cfcccf0cd393c450a15ad8b0ff5cc6b0bb693d (diff) |
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.
-rw-r--r-- | object_collection_manager/__init__.py | 2 | ||||
-rw-r--r-- | object_collection_manager/ui.py | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/object_collection_manager/__init__.py b/object_collection_manager/__init__.py index 90179b69..60dae31f 100644 --- a/object_collection_manager/__init__.py +++ b/object_collection_manager/__init__.py @@ -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 diff --git a/object_collection_manager/ui.py b/object_collection_manager/ui.py index 00f5c2f7..812310dd 100644 --- a/object_collection_manager/ui.py +++ b/object_collection_manager/ui.py @@ -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() |