Skip to content

Commit 6c026cc

Browse files
authored
Merge pull request #1816 from HEXRD/fix-structureless-undo
Verify calibrators exist before updating them
2 parents 91ff12b + 61ad3ae commit 6c026cc

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

hexrdgui/calibration/calibration_dialog_callbacks.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,11 @@ def pop_undo_stack(self):
172172
self.instr,
173173
stack_item['instr_params'],
174174
)
175-
for calibrator in self.calibrator.calibrators:
176-
calibrator.update_from_lmfit_params(stack_item['params'])
175+
if hasattr(self.calibrator, 'calibrators'):
176+
# The instrument calibrator will have a list of calibrators
177+
# The structureless calibrator will not
178+
for calibrator in self.calibrator.calibrators:
179+
calibrator.update_from_lmfit_params(stack_item['params'])
177180

178181
self.update_config_from_instrument()
179182
self.update_dialog_from_calibrator()

0 commit comments

Comments
 (0)