It is possible on file load that the `previous_active_brush_reference` is an invalid old memory location. To prevent this, set the ptr to nullptr on file load, as it should only be used within a given session. Pull Request: https://projects.blender.org/blender/blender/pulls/139618