Index: /trunk/ppStack/src/ppStackLoop.c
===================================================================
--- /trunk/ppStack/src/ppStackLoop.c	(revision 19410)
+++ /trunk/ppStack/src/ppStackLoop.c	(revision 19411)
@@ -795,23 +795,25 @@
             ppStackThread *thread = stack->threads->data[0]; // Representative stack
             pmReadout *inRO = thread->readouts->data[i]; // Template readout
-            pmHDU *inHDU = pmHDUFromCell(inRO->parent); // Template HDU
-            pmHDU *outHDU = pmHDUFromCell(outRO->parent); // Output HDU
-            pmChip *outChip = outRO->parent->parent; // Output chip
-            pmFPA *outFPA = outChip->parent; // Output FPA
-            if (!outHDU || !inHDU) {
-                psWarning("Unable to find HDU at FPA level to copy astrometry.");
-            } else {
-                if (!pmAstromReadWCS(outFPA, outChip, inHDU->header, 1.0)) {
-                    psErrorClear();
-                    psWarning("Unable to read WCS astrometry from input FPA.");
-                    wcsDone = false;
+            if (inRO) {
+                pmHDU *inHDU = pmHDUFromCell(inRO->parent); // Template HDU
+                pmHDU *outHDU = pmHDUFromCell(outRO->parent); // Output HDU
+                pmChip *outChip = outRO->parent->parent; // Output chip
+                pmFPA *outFPA = outChip->parent; // Output FPA
+                if (!outHDU || !inHDU) {
+                    psWarning("Unable to find HDU at FPA level to copy astrometry.");
                 } else {
-                    if (!outHDU->header) {
-                        outHDU->header = psMetadataAlloc();
-                    }
-                    if (!pmAstromWriteWCS(outHDU->header, outFPA, outChip, WCS_TOLERANCE)) {
+                    if (!pmAstromReadWCS(outFPA, outChip, inHDU->header, 1.0)) {
                         psErrorClear();
-                        psWarning("Unable to write WCS astrometry to output FPA.");
+                        psWarning("Unable to read WCS astrometry from input FPA.");
                         wcsDone = false;
+                    } else {
+                        if (!outHDU->header) {
+                            outHDU->header = psMetadataAlloc();
+                        }
+                        if (!pmAstromWriteWCS(outHDU->header, outFPA, outChip, WCS_TOLERANCE)) {
+                            psErrorClear();
+                            psWarning("Unable to write WCS astrometry to output FPA.");
+                            wcsDone = false;
+                        }
                     }
                 }
