Bug fix #2260
authorTon Roosendaal <ton@blender.org>
Tue, 1 Mar 2005 14:03:59 +0000 (14:03 +0000)
committerTon Roosendaal <ton@blender.org>
Tue, 1 Mar 2005 14:03:59 +0000 (14:03 +0000)
"Select group, Parent" menu crashed when parent was in other scene.
Simply added extra check in code.

source/blender/src/space.c

index 6cd90134a866dfd61762e0b96912f7d0b081c201..0ec8b1433531ee3139978622c42ce75fede7f77b 100644 (file)
@@ -555,16 +555,19 @@ void select_parent(void)  /* Makes parent active and de-selected OBACT */
        while(base) {
                if(base->object==BASACT->object->parent) { basact=base; break; }
                base=base->next;
-               if(base==0) base= FIRSTBASE;
+               if(base==NULL) base= FIRSTBASE;
                if(base==startbase) break;
        }
-       oldbasact = BASACT;
-       BASACT = basact;
-       basact->flag |= SELECT;         
-       
-       basact->object->flag= basact->flag;
-       
-       set_active_base(basact);
+       /* can be NULL if parent in other scene */
+       if(basact) {
+               oldbasact = BASACT;
+               BASACT = basact;
+               basact->flag |= SELECT;         
+               
+               basact->object->flag= basact->flag;
+               
+               set_active_base(basact);
+       }
 }