Index: trunk/psModules/src/pmSubtractBias.c
===================================================================
--- trunk/psModules/src/pmSubtractBias.c	(revision 2127)
+++ trunk/psModules/src/pmSubtractBias.c	(revision 2132)
@@ -6,6 +6,6 @@
  *  @author George Gusciora, MHPCC
  *
- *  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-10-14 19:06:19 $
+ *  @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-10-14 22:33:28 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -38,8 +38,8 @@
 
     if (((in->image)->numRows + in->row0 - bias->row0) > (bias->image)->numRows) {
-        // XXX: psErrorMsg() bias image does not have enough rows.
+        psError(__func__, "bias image does not have enough rows\n");
     }
     if (((in->image)->numCols + in->row0 - bias->row0) > (bias->image)->numCols) {
-        // XXX: psErrorMsg() bias image does not have enough columns.
+        psError(__func__, "bias image does not have enough columns\n");
     }
 
@@ -52,7 +52,8 @@
             (in->image)->data.F32[i][j]-=
                 (bias->image)->data.F32[i+in->row0-bias->row0][j+in->col0-bias->col0];
-
-            ((in->mask)->data.U8[i][j])|=
-                (bias->mask)->data.U8[i+in->row0-bias->row0][j+in->col0-bias->col0];
+            if ((in->mask != NULL) && (bias->mask != NULL)) {
+                ((in->mask)->data.U8[i][j])|=
+                    (bias->mask)->data.U8[i+in->row0-bias->row0][j+in->col0-bias->col0];
+            }
         }
     }
@@ -219,7 +220,5 @@
     psSpline1D *mySpline;
 
-    if (in == NULL) {
-        //XXX: psErrorMsg()
-    }
+    PS_CHECK_NULL_PTR_RETURN_NULL(in);
 
     //
@@ -231,4 +230,5 @@
 
     if ((overscans == NULL) && (overScanAxis != PM_OVERSCAN_NONE)) {
+        psError(__func__, "(overscans == NULL) && (overScanAxis != PM_OVERSCAN_NONE)\n");
         //XXX: psErrorMsg()
         return(in);
@@ -240,10 +240,11 @@
         //XXX: psWarningMsg()
         //XXX: Then what?
-        return(in);
+        printf("WARNING: overScanAxis equals NONE or ALL, and fit equals NONE\n");
+        //        return(in);
     }
 
     if (overScanAxis == PM_OVERSCAN_NONE) {
         if (overscans != NULL) {
-            //XXX: psWarningMsg()
+            printf("WARNING: overScanAxis equals NONE and overscans does not equal NULL\n");
         }
         return(psSubtractFrame(in, bias));
