Index: trunk/psphot/src/psphotReadout.c
===================================================================
--- trunk/psphot/src/psphotReadout.c	(revision 19911)
+++ trunk/psphot/src/psphotReadout.c	(revision 20170)
@@ -68,5 +68,5 @@
         return psphotReadoutCleanup (config, readout, recipe, detections, psf, NULL);
     }
- 
+
     // construct sources and measure basic stats
     psArray *sources = psphotSourceStats (readout, recipe, detections);
@@ -95,5 +95,8 @@
     }
 
-    psphotImageQuality (recipe, sources);
+    if (!psphotImageQuality (recipe, sources)) {
+        psLogMsg("psphot", 3, "failed to measure image quality");
+        return psphotReadoutCleanup(config, readout, recipe, detections, psf, sources);
+    }
 
     // if we were not supplied a PSF, choose one here
