Index: /trunk/psModules/src/camera/pmFPAWrite.c
===================================================================
--- /trunk/psModules/src/camera/pmFPAWrite.c	(revision 24767)
+++ /trunk/psModules/src/camera/pmFPAWrite.c	(revision 24768)
@@ -160,9 +160,26 @@
     psArray **imageArray = appropriateImageArray(hdu, type); // Array of images in the HDU
 
+    // XXX detect missing variance & mask images...
+
     // Generate the HDU if needed --- this is required after a pmFPACopy, or similar, which does not
     // generate the HDU, but only copies the structure.
-    if (!blank && !hdu->blankPHU && !*imageArray && (!pmHDUGenerateForCell(cell) || !*imageArray)) {
-        psError(PS_ERR_UNKNOWN, false, "Unable to generate HDU for cell --- likely programming error.");
-        return false;
+    if (!blank && !hdu->blankPHU && !*imageArray) {
+	if (!pmHDUGenerateForCell(cell)) {
+	    psError(PS_ERR_UNKNOWN, false, "Unable to generate HDU for cell --- likely programming error.");
+	    return false;
+	}
+	if (!*imageArray) {
+	    if (type == FPA_WRITE_TYPE_IMAGE) {
+		psError(PS_ERR_UNKNOWN, false, "Expected to write an image, but it is missing...programming error?.");
+		return false;
+	    }
+	    if (type == FPA_WRITE_TYPE_MASK) {
+		psWarning("No mask image for this cell; skipping");
+	    }
+	    if (type == FPA_WRITE_TYPE_VARIANCE) {
+		psWarning("No variance image for this cell; skipping");
+	    }
+	    return true;
+	}
     }
 
