Manual merge of soc-2009-kazanbas branch:
[blender.git] / source / blender / blenkernel / intern / mesh.c
index c92eda6..431543f 100644 (file)
@@ -542,7 +542,8 @@ void set_mesh(Object *ob, Mesh *me)
        
        if(ob->type==OB_MESH) {
                old= ob->data;
-               old->id.us--;
+               if (old)
+                       old->id.us--;
                ob->data= me;
                id_us_plus((ID *)me);
        }