This commit fixes missed line that would allow the index for the max range spectra to be updated Re #27444