When performing an undo in Sculpt Mode with Dyntopo enabled, it is possible that the active color attribute exists in the original mesh but not on the BMesh used by Dyntopo. When attempting to extract this color data, this can then lead to a crash. To prevent this, use the BMesh as the source of truth for existence of generic attributes when mode inside Sculpt Mode when Dyntopo is enabled. Pull Request: https://projects.blender.org/blender/blender/pulls/137828