Fix (unreported) crash when listing available fmodifier types.

Some types are defined but not yet implemented...
This commit is contained in:
Bastien Montagne 2016-04-22 15:23:59 +02:00
parent a2779a4606
commit f69b364b88
2 changed files with 6 additions and 2 deletions

View File

@ -2393,7 +2393,9 @@ static EnumPropertyItem *graph_fmodifier_itemf(bContext *C, PointerRNA *UNUSED(p
continue;
index = RNA_enum_from_value(rna_enum_fmodifier_type_items, fmi->type);
RNA_enum_item_add(&item, &totitem, &rna_enum_fmodifier_type_items[index]);
if (index != -1) { /* Not all types are implemented yet... */
RNA_enum_item_add(&item, &totitem, &rna_enum_fmodifier_type_items[index]);
}
}
RNA_enum_item_end(&item, &totitem);

View File

@ -2259,7 +2259,9 @@ static EnumPropertyItem *nla_fmodifier_itemf(bContext *C, PointerRNA *UNUSED(ptr
continue;
index = RNA_enum_from_value(rna_enum_fmodifier_type_items, fmi->type);
RNA_enum_item_add(&item, &totitem, &rna_enum_fmodifier_type_items[index]);
if (index != -1) { /* Not all types are implemented yet... */
RNA_enum_item_add(&item, &totitem, &rna_enum_fmodifier_type_items[index]);
}
}
RNA_enum_item_end(&item, &totitem);