From 109100869a7e65453bcb4293b56750ff09a6e87a Mon Sep 17 00:00:00 2001 From: Philipp Oeser Date: Fri, 21 Mar 2025 10:35:31 +0100 Subject: [PATCH] Fix #136252: Extra chevron on Particle context data breadcrumbs Dont increment the path count (and dont create a corresponding pointer) in `ButsContextPath` when there is no current particle system. This alone would do the trick for particles, but I have also changed `buttons_panel_context_draw` slightly (so that it checks if the pointer is valid -- earlying out otherwise -- **before** drawing the triangle icon) in case it might happen elsewhere too. Pull Request: https://projects.blender.org/blender/blender/pulls/136256 --- .../editors/space_buttons/buttons_context.cc | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/source/blender/editors/space_buttons/buttons_context.cc b/source/blender/editors/space_buttons/buttons_context.cc index d2632cccaaf..4f8e2b86554 100644 --- a/source/blender/editors/space_buttons/buttons_context.cc +++ b/source/blender/editors/space_buttons/buttons_context.cc @@ -437,9 +437,10 @@ static bool buttons_context_path_particle(ButsContextPath *path) if (ob && ob->type == OB_MESH) { ParticleSystem *psys = psys_get_current(ob); - - path->ptr[path->len] = RNA_pointer_create_discrete(&ob->id, &RNA_ParticleSystem, psys); - path->len++; + if (psys != nullptr) { + path->ptr[path->len] = RNA_pointer_create_discrete(&ob->id, &RNA_ParticleSystem, psys); + path->len++; + } return true; } } @@ -1226,15 +1227,15 @@ static void buttons_panel_context_draw(const bContext *C, Panel *panel) continue; } + if (ptr->data == nullptr) { + continue; + } + /* Add > triangle. */ if (!first) { uiItemL(row, "", ICON_RIGHTARROW); } - if (ptr->data == nullptr) { - continue; - } - /* Add icon and name. */ int icon = RNA_struct_ui_icon(ptr->type); char namebuf[128];