KeyingSets: Fixing crash when adding KeyingSets and no group name is supplied
authorJoshua Leung <aligorith@gmail.com>
Thu, 12 Feb 2009 23:25:36 +0000 (23:25 +0000)
committerJoshua Leung <aligorith@gmail.com>
Thu, 12 Feb 2009 23:25:36 +0000 (23:25 +0000)
source/blender/blenkernel/intern/anim_sys.c

index 098d0ad7a32e4db2ae24e2cec7e5c3d4ade8b782..cb29685bd157ef958260a16a6f8bf14b792950b6 100644 (file)
@@ -177,7 +177,10 @@ KeyingSet *BKE_keyingset_add (ListBase *list, const char name[], short flag, sho
        /* allocate new KeyingSet */
        ks= MEM_callocN(sizeof(KeyingSet), "KeyingSet");
        
-       BLI_snprintf(ks->name, 64, name);
+       if (name)
+               BLI_snprintf(ks->name, 64, name);
+       else
+               strcpy(ks->name, "Keying Set");
        
        ks->flag= flag;
        ks->keyingflag= keyingflag;
@@ -212,7 +215,10 @@ void BKE_keyingset_add_destination (KeyingSet *ks, ID *id, const char group_name
        /* just store absolute info */
        if (ks->flag & KEYINGSET_ABSOLUTE) {
                ksp->id= id;
-               BLI_snprintf(ksp->group, 64, group_name);
+               if (group_name)
+                       BLI_snprintf(ksp->group, 64, group_name);
+               else
+                       strcpy(ksp->group, "");
        }
        
        /* just copy path info */