KeyingSets: Fixing crash when adding KeyingSets and no group name is supplied

This commit is contained in:
Joshua Leung
2009-02-12 23:25:36 +00:00
parent c5d8155aeb
commit ed7e211c2d

View 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 */