When armature is selected for custom shape of a bone, we run into stack overflow due to recursive calls. To prevent this situation, exclude armature object type from the custom shape list. This also clears the `pchan->custom` pointer after loading/linking a blend file. Otherwise a linked Armature object can still be assigned indirectly, by renaming objects in the library file. Fixes: #140747 Fixes: #140959 Co-authored-by: Sybren A. Stüvel <sybren@blender.org> Pull Request: https://projects.blender.org/blender/blender/pulls/140851