Don't silently accept genbox -nmol without -ci
authorMark Abraham <mark.j.abraham@gmail.com>
Tue, 14 Aug 2012 04:59:11 +0000 (14:59 +1000)
committerMark Abraham <mark.j.abraham@gmail.com>
Tue, 14 Aug 2012 04:59:11 +0000 (14:59 +1000)
Change-Id: Ia50da1ee741eec9ea49ec04eb9fd14dd6b3116fc

src/tools/gmx_genbox.c

index 0621c660bb75545463a9c129afcd8ab5bc8c1a01..6e224e991daad150163051328e2bcbf7c1b308b8 100644 (file)
@@ -743,6 +743,12 @@ int gmx_genbox(int argc,char *argv[])
   if (bInsert && nmol_ins<=0)
     gmx_fatal(FARGS,"When specifying inserted molecules (-ci), "
                "-nmol must be larger than 0");
+  if (!bInsert && nmol_ins > 0)
+  {
+    gmx_fatal(FARGS,
+              "You tried to insert molecules with -nmol, but did not supply "
+              "a molecule to insert with -ci.");
+  }
   if (!bProt && !bBox)
     gmx_fatal(FARGS,"When no solute (-cp) is specified, "
                "a box size (-box) must be specified");