Add TNG writing and reading support
[alexxy/gromacs.git] / src / gromacs / fileio / xtcio.c
index 039e1020a8c7a1c1a476ef15f606e2f52467685c..d7a866597227015529072bb5c7cf59ba2ae29abb 100644 (file)
@@ -209,6 +209,14 @@ int write_xtc(t_fileio *fio,
     gmx_bool bDum;
     int      bOK;
 
+    if (!fio)
+    {
+        /* This means the fio object is not being used, e.g. because
+           we are actually writing TNG output. We still have to return
+           a pseudo-success value, to keep some callers happy. */
+        return 1;
+    }
+
     xd = gmx_fio_getxdr(fio);
     /* write magic number and xtc identidier */
     if (xtc_header(xd, &magic_number, &natoms, &step, &time, FALSE, &bDum) == 0)