fixed index panic error when #offsets is one less than #lines
Merge pull request #743 from control-center/feature/ZEN-12991

fixed index panic error when #offsets is one less than #lines