Index: trunk/tools/eam/rawfix.20230221/src/advance.rawfix.pl
===================================================================
--- trunk/tools/eam/rawfix.20230221/src/advance.rawfix.pl	(revision 42446)
+++ trunk/tools/eam/rawfix.20230221/src/advance.rawfix.pl	(revision 42449)
@@ -144,4 +144,8 @@
     my $Nfail    = $values[14];
     
+    # in state of 'new', we do not care what the values of the stat fields are.
+    # they may be NULL, so do not yet try to do math on them here
+    if ($state eq "new")                          		      { 	  &update_night_state ($dateobs, "ckchip.new", 0);     return "NEW"; }
+
     my $Ndone = $Ngood + $Ndead + $Ngone + $Nfail;
     my $Nwait = $Nsing + $Ndups + $Nsbck + $Nxbck + $Ncul1 + $Ncul2 + $Ncul3;
@@ -151,5 +155,4 @@
     # check for completion here first (otherwise, advance fixchip.done below)
     if (($state eq "fixchip.done") and ($iter > 0) and ($Nwait == 0)) { 	  &update_night_state ($dateobs, "DONE");              return "DONE"; }
-    if ($state eq "new")                          		      { 	  &update_night_state ($dateobs, "ckchip.new", 0);     return "NEW"; }
     if ($state eq "ckchip.done")                   		      {           &update_night_state ($dateobs, "fixchip.new");       return "NEW"; }
     if ($state eq "fixchip.done")                  		      { 	  &update_night_state ($dateobs, "md5sum.new");        return "NEW"; }
