Index: /trunk/psphot/src/psphotChoosePSF.c
===================================================================
--- /trunk/psphot/src/psphotChoosePSF.c	(revision 9516)
+++ /trunk/psphot/src/psphotChoosePSF.c	(revision 9517)
@@ -126,7 +126,13 @@
     psEllipseAxes axes;
 
+    PS_ASSERT_PTR_NON_NULL(readout, false);
+    PS_ASSERT_PTR_NON_NULL(recipe, false);
+    PS_ASSERT_PTR_NON_NULL(psf, false);
+
     psImage *image = readout->image;
+    PS_ASSERT_PTR_NON_NULL(image, false);
 
     pmModel *modelEXT = pmModelAlloc (psf->type);
+    PS_ASSERT_PTR_NON_NULL(modelEXT, false);
 
     // make a model with unit central intensity at the image center
@@ -138,4 +144,5 @@
     // construct a PSF model at this coordinate
     pmModel *modelPSF = pmModelFromPSF (modelEXT, psf);
+    PS_ASSERT_PTR_NON_NULL(modelPSF, false);
 
     // get the correct model-radius function
@@ -175,6 +182,11 @@
     psEllipseAxes axes;
 
+    PS_ASSERT_PTR_NON_NULL(readout, false);
+    PS_ASSERT_PTR_NON_NULL(recipe, false);
+    PS_ASSERT_PTR_NON_NULL(sources, false);
+
     for (int i = 0; i < sources->n; i++) {
         pmSource *source = sources->data[i];
+	if (!source) continue;
         if (!(source->mode & PM_SOURCE_MODE_PSFSTAR)) continue;
 
