Index: /branches/eam_02_branch/psphot/src/psphotChoosePSF.c
===================================================================
--- /branches/eam_02_branch/psphot/src/psphotChoosePSF.c	(revision 12945)
+++ /branches/eam_02_branch/psphot/src/psphotChoosePSF.c	(revision 12946)
@@ -155,6 +155,4 @@
     try = models->data[bestN];
 
-    // XXX calculate the PSF residual table here (and add to the pmPSF structure)
-
     // measure and save the median value of dparams[PM_PAR_SXX],dparams[PM_PAR_SYY]
     // these are used by psphotEvalPSF to identify extended sources
@@ -224,5 +222,8 @@
 
     // build a PSF residual image
-    psphotMakeResiduals (try->sources, recipe, try->psf);
+    if (!psphotMakeResiduals (try->sources, recipe, try->psf)) {
+	psError(PSPHOT_ERR_PSF, false, "Unable to construct residual table for PSF");
+	return NULL;
+    }
 
     // XXX test dump of psf star data and psf-subtracted image
