Skip to content

Commit

Permalink
Merge pull request #97 from BitcoinSchema/nil-check
Browse files Browse the repository at this point in the history
nil check
  • Loading branch information
mrz1836 authored Apr 16, 2024
2 parents dc61e0d + 4bbc512 commit 0509992
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 0509992

Please sign in to comment.