Caused by 7b0ea0f1b4
By default, Color Palettes are only drawn in the UI in the context of
**painting**. UI button code then tries to update an appropriate brush
from edits to the palette.
In the report though, a palette was created and displayed via python,
making changes in Object/Edit/Pose would then crash.
So a valid `Paint` and `Brush` were assumed. `Paint` was already checked
for in a324a19f1b, but since 7b0ea0f1b4, `Paint`(if we actually have
it, e.g.from `ImagePaintSettings` [see a324a19f1b]) only has its
`brush` set once we enter texturepaint once.
Solved by checking we have a valid Brush in corresponding UI code to
begin with.
Pull Request: https://projects.blender.org/blender/blender/pulls/131031