[Bf-extensions-cvs] [c673be0c] blender-v2.83-release: Collection Manager: Fix invalid list index. Task: T69577

Ryan Inch noreply at git.blender.org
Sat May 23 07:17:40 CEST 2020


Commit: c673be0c38021b1b530868e6e88a365cfc8a4d39
Author: Ryan Inch
Date:   Sat May 23 01:12:36 2020 -0400
Branches: blender-v2.83-release
https://developer.blender.org/rBAc673be0c38021b1b530868e6e88a365cfc8a4d39

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.

===================================================================

M	object_collection_manager/__init__.py
M	object_collection_manager/ui.py

===================================================================

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()



More information about the Bf-extensions-cvs mailing list