Skip to content

Commit

Permalink
nil check
Browse files Browse the repository at this point in the history
  • Loading branch information
David Case committed Apr 15, 2024
1 parent ac4a22c commit 4bbc512
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions bob.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ func (a *Aip) FromTape(tape bpu.Tape) {
// Loop over remaining indices if they exist and append to indices slice
a.Indices = make([]int, len(tape.Cell)-finalIndexCount)
for x := finalIndexCount - 1; x < len(tape.Cell); x++ {
if tape.Cell[x].S == nil {
continue
}
if index, err := strconv.Atoi(*tape.Cell[x].S); err == nil {
a.Indices = append(a.Indices, index)
}
Expand Down

0 comments on commit 4bbc512

Please sign in to comment.