Index: trunk/ppSub/src/ppSubReadout.c
===================================================================
--- trunk/ppSub/src/ppSubReadout.c	(revision 17790)
+++ trunk/ppSub/src/ppSubReadout.c	(revision 17793)
@@ -246,7 +246,9 @@
         pmFPAfileActivate(config->files, false, "PSPHOT.INPUT");
 
-        pmChip *photChip = pmFPAviewThisChip(view, photFile->fpa); // Chip with the sources
-        psArray *sources = psMetadataLookupPtr(NULL, photChip->analysis, "PSPHOT.SOURCES"); // Sources
-        psMetadataAddS32(stats, PS_LIST_TAIL, "NUM_SOURCES", 0, "Number of sources detected", sources->n);
+        if (stats) {
+            pmChip *photChip = pmFPAviewThisChip(view, photFile->fpa); // Chip with the sources
+            psArray *sources = psMetadataLookupPtr(NULL, photChip->analysis, "PSPHOT.SOURCES"); // Sources
+            psMetadataAddS32(stats, PS_LIST_TAIL, "NUM_SOURCES", 0, "Number of sources detected", sources->n);
+        }
     }
 
