Index: trunk/psModules/src/camera/pmFPAWrite.c
===================================================================
--- trunk/psModules/src/camera/pmFPAWrite.c	(revision 7017)
+++ trunk/psModules/src/camera/pmFPAWrite.c	(revision 7097)
@@ -15,4 +15,8 @@
 {
     pmHDU *hdu = pmHDUFromReadout(readout); // The HDU to which to write
+    if (!hdu) {
+        psError(PS_ERR_IO, false, "Unable to find HDU for readout.\n");
+        return false;
+    }
     psMetadata *header = hdu->header;   // The FITS header
     if (!header) {
@@ -43,4 +47,8 @@
     }
 
+    if (!hdu->images) {
+        psError(PS_ERR_IO, true, "No images allocated in HDU.\n");
+        return false;
+    }
     psImage *image = hdu->images->data[z]; // The image from the HDU to write
     if (readout->row0 == 0 && readout->col0 == 0 && z == 0) {
