Bug fix #2438
authorTon Roosendaal <ton@blender.org>
Tue, 12 Apr 2005 11:53:46 +0000 (11:53 +0000)
committerTon Roosendaal <ton@blender.org>
Tue, 12 Apr 2005 11:53:46 +0000 (11:53 +0000)
Snapping code checked for Hooks in object, but forgot to check first if
the Hook->parent existed. Crashed on 'empty' hooks.

source/blender/src/edit.c

index fdcdf2401c16d6a676ce604618986c597f394b3b..fb3536b293959378e4edc41d457ed135feb33a36 100644 (file)
@@ -715,7 +715,7 @@ static void update_select_dependency(void)
                if(ob->hooks.first) {
                        ObHook *hook= ob->hooks.first;
                        while(hook) {
-                               if(hook->parent->flag & SELECT) freedisplist(&ob->disp);
+                               if(hook->parent && (hook->parent->flag & SELECT)) freedisplist(&ob->disp);
                                hook= hook->next;
                        }
                }