fix [#29947] Blender crashes when duplicate bones
[blender.git] / source / blender / editors / animation / anim_deps.c
index fdccf5d4baa10056824944c61b2b561e57e8dd9c..3f851938a838ffbb32e4aec5e8f44360e0b46a23 100644 (file)
@@ -148,7 +148,7 @@ static void animchan_sync_group (bAnimContext *UNUSED(ac), bAnimListElem *ale)
                        
                        /* if one matches, sync the selection status */
                        if (pchan) {
-                               if (pchan->bone->flag & BONE_SELECTED)
+                               if (pchan->bone && pchan->bone->flag & BONE_SELECTED)
                                        agrp->flag |= AGRP_SELECTED;
                                else
                                        agrp->flag &= ~AGRP_SELECTED;