Index: /branches/pap_branch_080320/psModules/src/detrend/pmShutterCorrection.c
===================================================================
--- /branches/pap_branch_080320/psModules/src/detrend/pmShutterCorrection.c	(revision 17131)
+++ /branches/pap_branch_080320/psModules/src/detrend/pmShutterCorrection.c	(revision 17132)
@@ -955,4 +955,11 @@
             pmShutterCorrection *corr = pmShutterCorrectionLinFit(data->exptimes, counts, errors, mask,
                                                                   reference, nIter, rej, maskVal);
+            if (!corr) {
+                // Nothing we can do about it
+                psErrorClear();
+                shutterImage->data.F32[yOut][xOut] = NAN;
+                patternImage->data.F32[yOut][xOut] = NAN;
+                continue;
+            }
             shutterImage->data.F32[yOut][xOut] = corr->offset;
             patternImage->data.F32[yOut][xOut] = corr->scale;
