Index: trunk/psModules/src/objects/pmPSFtry.c
===================================================================
--- trunk/psModules/src/objects/pmPSFtry.c	(revision 18857)
+++ trunk/psModules/src/objects/pmPSFtry.c	(revision 19103)
@@ -5,6 +5,6 @@
  *  @author EAM, IfA
  *
- *  @version $Revision: 1.59 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2008-08-01 22:11:51 $
+ *  @version $Revision: 1.60 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2008-08-18 00:40:47 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -223,4 +223,10 @@
     psTrace ("psphot.psftry", 3, "keeping %d of %ld PSF candidates (PSF)\n", Npsf, sources->n);
 
+    if (Npsf == 0) {
+        psError(PS_ERR_UNKNOWN, true, "No sources with good PSF fits after model is built.");
+        psFree(psfTry);
+        return NULL;
+    }
+
     // measure the chi-square trend as a function of flux (PAR[PM_PAR_I0])
     // this should be linear for Poisson errors and quadratic for constant sky errors
