Index: trunk/psModules/src/objects/pmPSF_IO.c
===================================================================
--- trunk/psModules/src/objects/pmPSF_IO.c	(revision 15706)
+++ trunk/psModules/src/objects/pmPSF_IO.c	(revision 15707)
@@ -6,6 +6,6 @@
  *  @author EAM, IfA
  *
- *  @version $Revision: 1.28 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2007-11-10 01:09:20 $
+ *  @version $Revision: 1.29 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2007-11-28 01:01:14 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -187,5 +187,4 @@
     PS_ASSERT_PTR_NON_NULL(file->fpa, false);
     bool status;
-    pmHDU *hdu;
     char *headName, *tableName, *residName;
 
@@ -205,5 +204,9 @@
 
     // get the current header
-    hdu = pmFPAviewThisHDU (view, file->fpa);
+    pmHDU *hdu = pmFPAviewThisHDU (view, file->fpa);
+    if (!hdu) {
+        psError(PS_ERR_UNKNOWN, false, "Unable to find HDU");
+        return false;
+    }
 
     // if file does not yet have a PHU, attempt to write one to disk
