Skip to content

Commit

Permalink
Fix panic during finalize if no i2c device has been initialized
Browse files Browse the repository at this point in the history
  • Loading branch information
zankich committed Jul 9, 2015
1 parent 761dae9 commit 5b94e59
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions platforms/intel-iot/edison/edison_adaptor.go
Original file line number Diff line number Diff line change
Expand Up @@ -293,13 +293,11 @@ func (e *EdisonAdaptor) Finalize() (errs []error) {
}
}
}
//if e.i2cDevice != nil {
//for _, i2cDevice := range e.i2cDevices {
if err := e.i2cDevice.Close(); errs != nil {
errs = append(errs, err)
if e.i2cDevice != nil {
if err := e.i2cDevice.Close(); errs != nil {
errs = append(errs, err)
}
}
//}
// }
return errs
}

Expand Down

0 comments on commit 5b94e59

Please sign in to comment.