diff --git a/src/parallel_io.c b/src/parallel_io.c index 9ca4a6eaf44b191475bb54269247e507d5ae2125..7b19ed7e18e7163340f305a97abef7e0db463c3b 100644 --- a/src/parallel_io.c +++ b/src/parallel_io.c @@ -1524,7 +1524,7 @@ void write_output_parallel(struct engine* e, for (int ptype = 0; ptype < swift_type_count; ptype++) { /* Don't do anything if no particle of this kind */ - if (N_total[ptype] == 0) continue; + if (N_total[ptype] == 0 || numFields[ptype] == 0) continue; /* Open the particle group in the file */ char partTypeGroupName[PARTICLE_GROUP_BUFFER_SIZE];