Skip to content

Commit

Permalink
check for sr end > num grid cells
Browse files Browse the repository at this point in the history
  • Loading branch information
ctessum committed Jul 9, 2016
1 parent d4361c9 commit 4e89c24
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sr/sr.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ func (sr *SR) Run(outfile string, layers []int, begin, end int) error {
for _, l := range layers {
layersMap[l] = Empty{}
}
if end < 0 {
end = len(sr.d.Cells())
if l := len(sr.d.Cells()); end < 0 || end > l {
end = l
}
for i := 0; i < len(sr.d.Cells()); i++ {

Expand Down

0 comments on commit 4e89c24

Please sign in to comment.