Bugfix #20664: NLA Editor - Hiding stuff causes instant crash ..
This commit is contained in:
@@ -372,6 +372,10 @@ void ANIM_flush_setting_anim_channels (bAnimContext *ac, ListBase *anim_data, bA
|
||||
bAnimListElem *ale, *match=NULL;
|
||||
int prevLevel=0, matchLevel=0;
|
||||
|
||||
/* sanity check */
|
||||
if (ELEM(NULL, anim_data, anim_data->first))
|
||||
return;
|
||||
|
||||
/* find the channel that got changed */
|
||||
for (ale= anim_data->first; ale; ale= ale->next) {
|
||||
/* compare data, and type as main way of identifying the channel */
|
||||
@@ -391,6 +395,11 @@ void ANIM_flush_setting_anim_channels (bAnimContext *ac, ListBase *anim_data, bA
|
||||
else {
|
||||
bAnimChannelType *acf= ANIM_channel_get_typeinfo(ale_setting);
|
||||
|
||||
if (acf == NULL) {
|
||||
printf("ERROR: no channel info for the changed channel \n");
|
||||
return;
|
||||
}
|
||||
|
||||
/* get the level of the channel that was affected
|
||||
* - we define the level as simply being the offset for the start of the channel
|
||||
*/
|
||||
@@ -416,6 +425,10 @@ void ANIM_flush_setting_anim_channels (bAnimContext *ac, ListBase *anim_data, bA
|
||||
bAnimChannelType *acf= ANIM_channel_get_typeinfo(ale);
|
||||
int level;
|
||||
|
||||
/* if no channel info was found, skip, since this type might not have any useful info */
|
||||
if (acf == NULL)
|
||||
continue;
|
||||
|
||||
/* get the level of the current channel traversed
|
||||
* - we define the level as simply being the offset for the start of the channel
|
||||
*/
|
||||
@@ -445,6 +458,10 @@ void ANIM_flush_setting_anim_channels (bAnimContext *ac, ListBase *anim_data, bA
|
||||
bAnimChannelType *acf= ANIM_channel_get_typeinfo(ale);
|
||||
int level;
|
||||
|
||||
/* if no channel info was found, skip, since this type might not have any useful info */
|
||||
if (acf == NULL)
|
||||
continue;
|
||||
|
||||
/* get the level of the current channel traversed
|
||||
* - we define the level as simply being the offset for the start of the channel
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user