fix for crash when inserting keyframes in a mesh
authorCampbell Barton <ideasman42@gmail.com>
Wed, 16 Dec 2009 17:49:51 +0000 (17:49 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 16 Dec 2009 17:49:51 +0000 (17:49 +0000)
source/blender/editors/animation/keyframing.c

index b126e57705e270e5183d1574894d1e69286203b1..6d8938d9545a804ab8c7b8ce7eafe9b3b3495895 100644 (file)
@@ -851,6 +851,11 @@ short insert_keyframe (ID *id, bAction *act, const char group[], const char rna_
                /* get action to add F-Curve+keyframe to */
                act= verify_adt_action(id, 1);
                
+               if(act==NULL) {
+                       printf("Insert Key: Could not insert keyframe, as this type does not support animation data (ID = %s, Path = %s)\n", id->name, rna_path);
+                       return 0;
+               }
+
                /* apply NLA-mapping to frame to use (if applicable) */
                cfra= BKE_nla_tweakedit_remap(adt, cfra, NLATIME_CONVERT_UNMAP);
        }