It's possible for the `bArmature.collection_array` to be null if Bone Collections were never added after armature creation. This could trip up undo processing later when we call `MEM_freeN` on the collection. Use a `MEM_SAFE_FREE` call instead which handles checking for null, as well as setting to null when complete. Pull Request: https://projects.blender.org/blender/blender/pulls/126945