Safety checks for macro defines
authorJoshua Leung <aligorith@gmail.com>
Fri, 18 Mar 2011 23:14:24 +0000 (23:14 +0000)
committerJoshua Leung <aligorith@gmail.com>
Fri, 18 Mar 2011 23:14:24 +0000 (23:14 +0000)
source/blender/editors/space_action/action_ops.c
source/blender/editors/space_graph/graph_ops.c

index b6fbc34550f2d8dd9f8c14a5208875bf00b73e72..38d221858b36b0f11ab3a7f5eec071c7cf698953 100644 (file)
@@ -95,9 +95,11 @@ void ED_operatormacros_action(void)
        wmOperatorTypeMacro *otmacro;
        
        ot= WM_operatortype_append_macro("ACTION_OT_duplicate_move", "Duplicate", OPTYPE_UNDO|OPTYPE_REGISTER);
-       WM_operatortype_macro_define(ot, "ACTION_OT_duplicate");
-       otmacro= WM_operatortype_macro_define(ot, "TRANSFORM_OT_transform");
-       RNA_int_set(otmacro->ptr, "mode", TFM_TIME_DUPLICATE);
+       if (ot) {
+               WM_operatortype_macro_define(ot, "ACTION_OT_duplicate");
+               otmacro= WM_operatortype_macro_define(ot, "TRANSFORM_OT_transform");
+                       RNA_int_set(otmacro->ptr, "mode", TFM_TIME_DUPLICATE);
+       }
        
 }
 
index da7de7ca003c57527c37d494c55746f670ea1ace..e2550bcf477bdad7f79d93a9d60fb05274a4e8bd 100644 (file)
@@ -276,10 +276,11 @@ void ED_operatormacros_graph(void)
        wmOperatorTypeMacro *otmacro;
        
        ot= WM_operatortype_append_macro("GRAPH_OT_duplicate_move", "Duplicate", OPTYPE_UNDO|OPTYPE_REGISTER);
-       WM_operatortype_macro_define(ot, "GRAPH_OT_duplicate");
-       otmacro= WM_operatortype_macro_define(ot, "TRANSFORM_OT_transform");
-       RNA_int_set(otmacro->ptr, "mode", TFM_TIME_DUPLICATE);
-
+       if (ot) {
+               WM_operatortype_macro_define(ot, "GRAPH_OT_duplicate");
+               otmacro= WM_operatortype_macro_define(ot, "TRANSFORM_OT_transform");
+                       RNA_int_set(otmacro->ptr, "mode", TFM_TIME_DUPLICATE);
+       }
 }