Skip to content

Commit

Permalink
add nil check
Browse files Browse the repository at this point in the history
  • Loading branch information
shruggr committed Feb 14, 2025
1 parent 257e304 commit af186ec
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions bob.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,10 @@ func (b *B) FromTape(tape bpu.Tape) (err error) {
}
}

bStr := *tape.Cell[startIndex+1].B
if b.Data, err = base64.StdEncoding.DecodeString(bStr); err != nil {
return
if tape.Cell[startIndex+1].B != nil {
if b.Data, err = base64.StdEncoding.DecodeString(*tape.Cell[startIndex+1].B); err != nil {
return
}
}

// Media type is after data
Expand Down

0 comments on commit af186ec

Please sign in to comment.