Merging r39634 through r39716 from trunk into soc-2011-tomato
[blender-staging.git] / source / blender / blenloader / intern / writefile.c
index bf4deb6ac1e8a578279a717c17317a8b3aab9ce5..a0df87599412647217c2f71b710828882a7c07e1 100644 (file)
@@ -868,10 +868,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);
                        }