Index: branches/pap/ppStack/src/ppStackPhotometry.c
===================================================================
--- branches/pap/ppStack/src/ppStackPhotometry.c	(revision 23948)
+++ branches/pap/ppStack/src/ppStackPhotometry.c	(revision 25027)
@@ -94,5 +94,5 @@
         psArray *sources = psMetadataLookupPtr(NULL, photRO->analysis, "PSPHOT.SOURCES"); // Sources
         psMetadataAddS32(options->stats, PS_LIST_TAIL, "NUM_SOURCES", 0,
-                         "Number of sources detected", sources->n);
+                         "Number of sources detected", sources ? sources->n : 0);
         psMetadataAddF32(options->stats, PS_LIST_TAIL, "TIME_PHOT", 0,
                          "Time to do photometry", psTimerMark("PPSTACK_PHOT"));
