== Action Editor ==
authorJoshua Leung <aligorith@gmail.com>
Tue, 6 Feb 2007 22:43:54 +0000 (22:43 +0000)
committerJoshua Leung <aligorith@gmail.com>
Tue, 6 Feb 2007 22:43:54 +0000 (22:43 +0000)
Added a few checks here and there to prevent crashes related to
no action being active.

This includes patch 5933 by Diego Borghetti (Plumiferos TD).

source/blender/src/editaction.c

index ba1c032d7769696eb5e8d7be23888ba61569d527..8150ffc1fdc5b570365f23feaf39fb65ee67fb47 100644 (file)
@@ -484,7 +484,7 @@ static void make_sel_cfra_list(Ipo *ipo, ListBase *elems)
  */
 void column_select_shapekeys(Key *key, int mode)
 {
-       if(key->ipo) {
+       if(key && key->ipo) {
                IpoCurve *icu;
                ListBase elems= {NULL, NULL};
                CfraElem *ce;
@@ -535,6 +535,9 @@ void column_select_actionkeys(bAction *act, int mode)
        bActionChannel *achan;
        bConstraintChannel *conchan;
 
+       if (!act)
+               return;
+       
        /* build list of columns */
        switch (mode) {
                case 1:
@@ -2334,7 +2337,7 @@ void snap_keys_to_frame(int snap_mode)
        if (key) {
                set_snap_meshchannels(key, snap_mode);
        }
-       else {
+       else if (act) {
                set_snap_actionchannels(act, snap_mode);
                remake_action_ipos (act);
        }
@@ -2435,7 +2438,7 @@ void mirror_action_keys(short mirror_mode)
        if (key) {
                mirror_meshchannels(key, mirror_mode);
        }
-       else {
+       else if (act) {
                mirror_actionchannels(act, mirror_mode);
                remake_action_ipos (act);
        }
@@ -3282,7 +3285,7 @@ void markers_selectkeys_between(void)
                if (key->ipo) 
                        borderselect_ipo_key(key->ipo, min, max, SELECT_ADD);
        }
-       else {
+       else if (act) {
                bActionChannel *achan;
                bConstraintChannel *conchan;