fix [#28352] Deleting group name in particle system -> panel: Render crashes Blender
authorCampbell Barton <ideasman42@gmail.com>
Tue, 23 Aug 2011 20:49:06 +0000 (20:49 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 23 Aug 2011 20:49:06 +0000 (20:49 +0000)
source/blender/blenloader/intern/writefile.c

index 085cd2c..5b7fcc0 100644 (file)
@@ -867,10 +867,12 @@ static void write_particlesettings(WriteData *wd, ListBase *idbase)
                        for(; dw; dw=dw->next) {
                                /* update indices */
                                dw->index = 0;
-                               go = part->dup_group->gobject.first;
-                               while(go && go->ob != dw->ob) {
-                                       go=go->next;
-                                       dw->index++;
+                               if(part->dup_group) { /* can be NULL if lining fails or set to None */
+                                       go = part->dup_group->gobject.first;
+                                       while(go && go->ob != dw->ob) {
+                                               go=go->next;
+                                               dw->index++;
+                                       }
                                }
                                writestruct(wd, DATA, "ParticleDupliWeight", 1, dw);
                        }