summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/stwcs/wcsutil/headerlet.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/stwcs/wcsutil/headerlet.py b/lib/stwcs/wcsutil/headerlet.py
index 6d3be64..c4bfa22 100644
--- a/lib/stwcs/wcsutil/headerlet.py
+++ b/lib/stwcs/wcsutil/headerlet.py
@@ -1835,8 +1835,9 @@ class Headerlet(pyfits.HDUList):
self.fit_kws = ['HDRNAME', 'NMATCH', 'CATALOG']
self.history = ''
# header['HISTORY'] returns an iterable of all HISTORY values
- for hist in self[0].header['HISTORY']:
- self.history += hist + '\n'
+ if 'HISTORY' in self[0].header:
+ for hist in self[0].header['HISTORY']:
+ self.history += hist + '\n'
self.d2imerr = 0
self.axiscorr = 1