Index: /trunk/psModules/src/objects/pmSourcePhotometry.c
===================================================================
--- /trunk/psModules/src/objects/pmSourcePhotometry.c	(revision 13372)
+++ /trunk/psModules/src/objects/pmSourcePhotometry.c	(revision 13373)
@@ -3,6 +3,6 @@
  *  @author EAM, IfA; GLG, MHPCC
  *
- *  @version $Revision: 1.24 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2007-04-26 01:20:29 $
+ *  @version $Revision: 1.25 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2007-05-14 13:39:40 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -382,10 +382,17 @@
 
     const psImage *Pi = Mi->pixels;
+    assert (Pi != NULL);
     const psImage *Pj = Mj->pixels;
+    assert (Pj != NULL);
 
     const psImage *Wi = Mi->weight;
+    if (!unweighted_sum) {
+	assert (Wi != NULL);
+    }
 
     const psImage *Ti = Mi->maskObj;
+    assert (Ti != NULL);
     const psImage *Tj = Mj->maskObj;
+    assert (Tj != NULL);
 
     Xs = PS_MAX (Pi->col0, Pj->col0);
@@ -438,10 +445,17 @@
 
     const psImage *Pi = Mi->pixels;
+    assert (Pi != NULL);
     const psImage *Pj = Mj->pixels;
+    assert (Pj != NULL);
 
     const psImage *Wi = Mi->weight;
+    if (!unweighted_sum) {
+	assert (Wi != NULL);
+    }
 
     const psImage *Ti = Mi->maskObj;
+    assert (Ti != NULL);
     const psImage *Tj = Mj->maskObj;
+    assert (Tj != NULL);
 
     Xs = PS_MAX (Pi->col0, Pj->col0);
@@ -489,6 +503,11 @@
 
     const psImage *Pi = Mi->pixels;
+    assert (Pi != NULL);
     const psImage *Wi = Mi->weight;
+    if (!unweighted_sum) {
+	assert (Wi != NULL);
+    }
     const psImage *Ti = Mi->maskObj;
+    assert (Ti != NULL);
 
     // note that this is addressing the same image pixels,
@@ -559,6 +578,11 @@
 
     const psImage *Pi = Mi->modelFlux;
+    assert (Pi != NULL);
     const psImage *Wi = Mi->weight;
+    if (!unweighted_sum) {
+	assert (Wi != NULL);
+    }
     const psImage *Ti = Mi->maskObj;
+    assert (Ti != NULL);
 
     for (int yi = 0; yi < Pi->numRows; yi++) {
@@ -607,10 +631,17 @@
 
     const psImage *Pi = Mi->modelFlux;
+    assert (Pi != NULL);
     const psImage *Pj = Mj->modelFlux;
+    assert (Pj != NULL);
 
     const psImage *Wi = Mi->weight;
+    if (!unweighted_sum) {
+	assert (Wi != NULL);
+    }
 
     const psImage *Ti = Mi->maskObj;
+    assert (Ti != NULL);
     const psImage *Tj = Mj->maskObj;
+    assert (Tj != NULL);
 
     Xs = PS_MAX (Pi->col0, Pj->col0);
@@ -663,10 +694,17 @@
 
     const psImage *Pi = Mi->pixels;
+    assert (Pi != NULL);
     const psImage *Pj = Mj->modelFlux;
+    assert (Pj != NULL);
 
     const psImage *Wi = Mi->weight;
+    if (!unweighted_sum) {
+	assert (Wi != NULL);
+    }
 
     const psImage *Ti = Mi->maskObj;
+    assert (Ti != NULL);
     const psImage *Tj = Mj->maskObj;
+    assert (Tj != NULL);
 
     Xs = PS_MAX (Pi->col0, Pj->col0);
