Fix #144361: Grease Pencil: Crash after deleting the Default Eraser

Make sure brush property is never null. Flag will avoid setting brush
to null inside `RNA_property_pointer_set`. Flag also prevents
`UI_BUT_VALUE_CLEAR/PREDEFINED_EXTRA_OP_ICON_CLEAR` from being set which
are responsible for the `X` button (`UI_OT_button_string_clear`).

Pull Request: https://projects.blender.org/blender/blender/pulls/144531
This commit is contained in:
Pratik Borhade
2025-08-27 12:08:29 +02:00
committed by Falk David
parent f248f3a5a2
commit 0516cd63fa

View File

@@ -653,7 +653,7 @@ static void rna_def_paint(BlenderRNA *brna)
"the last used brush on file load");
prop = RNA_def_property(srna, "eraser_brush", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_flag(prop, PROP_EDITABLE | PROP_NEVER_UNLINK);
RNA_def_property_struct_type(prop, "Brush");
RNA_def_property_pointer_funcs(prop,
"rna_Paint_eraser_brush_get",