Index: trunk/psModules/src/objects/pmSource.c
===================================================================
--- trunk/psModules/src/objects/pmSource.c	(revision 14805)
+++ trunk/psModules/src/objects/pmSource.c	(revision 14812)
@@ -6,6 +6,6 @@
  *  @author EAM, IfA: significant modifications.
  *
- *  @version $Revision: 1.35 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2007-08-24 00:11:02 $
+ *  @version $Revision: 1.36 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2007-09-11 01:30:23 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -174,11 +174,14 @@
 
     // these images are subset images of the equivalent parents
-    mySource->pixels   = psMemIncrRefCounter(psImageSubset(readout->image, srcRegion));
-    mySource->weight   = psMemIncrRefCounter(psImageSubset(readout->weight, srcRegion));
-    mySource->maskView = psMemIncrRefCounter(psImageSubset(readout->mask,  srcRegion));
+    mySource->pixels = psMemIncrRefCounter(psImageSubset(readout->image, srcRegion));
+    if (readout->weight) {
+        mySource->weight = psMemIncrRefCounter(psImageSubset(readout->weight, srcRegion));
+    }
+    if (readout->mask) {
+        mySource->maskView = psMemIncrRefCounter(psImageSubset(readout->mask,  srcRegion));
+        // the object mask is a copy, and used to define the source pixels
+        mySource->maskObj = psImageCopy(NULL, mySource->maskView, PS_TYPE_MASK);
+    }
     mySource->region   = srcRegion;
-
-    // the object mask is a copy, and used to define the source pixels
-    mySource->maskObj = psImageCopy (NULL, mySource->maskView, PS_TYPE_MASK);
 
     return true;
@@ -893,5 +896,5 @@
 
     if (isPSF) {
-	*isPSF = false;
+        *isPSF = false;
     }
 
@@ -908,8 +911,8 @@
 // XXX when should I return the modelConv ??
       case PM_SOURCE_TYPE_EXTENDED:
-	model = source->modelConv;
-	if (!model) {
-	    model = source->modelEXT;
-	}
+        model = source->modelConv;
+        if (!model) {
+            model = source->modelEXT;
+        }
         if (!model && source->modelPSF) {
             if (isPSF) {
