[Bf-blender-cvs] [f69b364] master: Fix (unreported) crash when listing available fmodifier types.

Bastien Montagne noreply at git.blender.org
Fri Apr 22 17:01:52 CEST 2016


Commit: f69b364b88ec2a1cdaa72944eedfe2de3f7c1775
Author: Bastien Montagne
Date:   Fri Apr 22 15:23:59 2016 +0200
Branches: master
https://developer.blender.org/rBf69b364b88ec2a1cdaa72944eedfe2de3f7c1775

Fix (unreported) crash when listing available fmodifier types.

Some types are defined but not yet implemented...

===================================================================

M	source/blender/editors/space_graph/graph_edit.c
M	source/blender/editors/space_nla/nla_edit.c

===================================================================

diff --git a/source/blender/editors/space_graph/graph_edit.c b/source/blender/editors/space_graph/graph_edit.c
index e1cd1da..effcd80 100644
--- a/source/blender/editors/space_graph/graph_edit.c
+++ b/source/blender/editors/space_graph/graph_edit.c
@@ -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);
diff --git a/source/blender/editors/space_nla/nla_edit.c b/source/blender/editors/space_nla/nla_edit.c
index baf87f3..a215969 100644
--- a/source/blender/editors/space_nla/nla_edit.c
+++ b/source/blender/editors/space_nla/nla_edit.c
@@ -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);




More information about the Bf-blender-cvs mailing list