FIX:Fix array out of bounds switch between coloring and text tools

jira: STUDIO-13303
Change-Id: Ic80224dc371247c4571a2f5471b68c011344621b
(cherry picked from commit 0ac418508c86709cd91b18268a1b33d209008f3d)
(cherry picked from commit b7f9cd292cb352891045f4b26924669ba0252231)
This commit is contained in:
zhou.xu
2025-08-14 21:42:15 +08:00
committed by Noisyfox
parent 574f597382
commit c4b9349d9d

View File

@@ -6129,7 +6129,9 @@ void ObjectList::update_after_undo_redo()
wxDataViewItemArray ObjectList::reorder_volumes_and_get_selection(int obj_idx, std::function<bool(const ModelVolume*)> add_to_selection/* = nullptr*/)
{
wxDataViewItemArray items;
if (obj_idx < 0 || obj_idx >= m_objects->size()) {
return items;
}
ModelObject* object = (*m_objects)[obj_idx];
if (object->volumes.size() <= 1)
return items;