Index: trunk/ppStack/src/ppStackPrepare.c
===================================================================
--- trunk/ppStack/src/ppStackPrepare.c	(revision 31158)
+++ trunk/ppStack/src/ppStackPrepare.c	(revision 31513)
@@ -144,4 +144,5 @@
     int numCols = 0, numRows = 0;   // Size of image
     options->sumExposure = 0.0;
+    int numWithSources = 0;
     for (int i = 0; i < num; i++) {
         pmFPAfile *file = pmFPAfileSelectSingle(config->files, "PPSTACK.INPUT", i); // File of interest
@@ -188,5 +189,5 @@
             pmReadout *ro = pmFPAviewThisReadout(view, file->fpa); // Readout with sources
             detections = psMetadataLookupPtr(NULL, ro->analysis, "PSPHOT.DETECTIONS"); // Sources
-            if (!detections || !detections->allSources) {
+            if (!detections || !detections->allSources || !detections->allSources->n) {
                 psWarning("No detections found for image %d --- rejecting.", i);
                 options->inputMask->data.PS_TYPE_VECTOR_MASK_DATA[i] = PPSTACK_MASK_CAL;
@@ -196,4 +197,5 @@
 
             options->sourceLists->data[i] = psMemIncrRefCounter(detections->allSources);
+            numWithSources++;
         }
 
@@ -230,4 +232,15 @@
             ppStackFileActivation(config, PPSTACK_FILES_PREPARE, true);
         }
+    }
+    if (numWithSources < 2) {
+        // This can happen if the inputs have been destreaked
+        psErrorStackPrint(stderr, "Not enough inputs have sources");
+        psWarning("No inputs have sources --- suspect bad data quality.");
+        if (options->quality == 0) {
+            options->quality = PPSTACK_ERR_DATA;
+        }
+        psErrorClear();
+        psFree(view);
+        return false;
     }
 
@@ -308,5 +321,21 @@
         psFree(psfs);
         if (!options->psf) {
+#if 1
             psError(psErrorCodeLast(), false, "Unable to determine output PSF.");
+#else
+            // This will repair the problem reproted in ticket 1427 but we aren't yet sure
+            // why ppStackPSF is failing so we are going to continue to fault for now
+            int errorCode = psErrorCodeLast();
+            if (errorCode == PPSTACK_ERR_PSF) {
+                psErrorStackPrint(stderr, "Unable to determine output PSF.");
+                psWarning("Unable to determine output PSF --- suspect bad data quality.");
+                if (options->quality == 0) {
+                    options->quality = errorCode;
+                }
+                psErrorClear();
+            } else {
+                psError(psErrorCodeLast(), false, "Unable to determine output PSF.");
+            }
+#endif // notyet
             psFree(view);
             return false;
