Skip to content

Commit

Permalink
Fix panic out of range, Fixes #8
Browse files Browse the repository at this point in the history
  • Loading branch information
schollz committed Apr 13, 2018
1 parent e11dc1a commit 43675d6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion reverse.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func ReverseScan(scanTime time.Duration) (sensors models.SensorData, err error)
continue
}
packet.RSSI = int(rssi)
if i > len(packets) {
if i >= len(packets) {
packets = append(packets, packet)
} else {
packets[i] = packet
Expand Down

0 comments on commit 43675d6

Please sign in to comment.