Commit dd2c8946 authored by Robert Applin's avatar Robert Applin
Browse files

Refs #0. Fix index out of range error in model analysis.

parent 5a838aa4
......@@ -289,7 +289,7 @@ class BasicFittingModel:
"""Clears the undo fit functions and other data for the currently selected index."""
current_dataset_index = self.fitting_context.current_dataset_index
for i, dataset_index in reversed(list(enumerate(self.fitting_context.dataset_indices_for_undo))):
if dataset_index == current_dataset_index:
if dataset_index == current_dataset_index and i < len(self.fitting_context.active_fit_history):
del self.fitting_context.active_fit_history[i]
del self.fitting_context.dataset_indices_for_undo[i]
del self.fitting_context.single_fit_functions_for_undo[i]
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment