mirror of
https://github.com/bettercap/bettercap
synced 2025-08-19 21:13:18 -07:00
fix: do not close serial port if nil (fixes #805)
This commit is contained in:
parent
ffe20c5357
commit
2610d4b1e4
1 changed files with 2 additions and 2 deletions
|
@ -191,11 +191,11 @@ func (mod *GPS) Start() error {
|
||||||
}
|
}
|
||||||
|
|
||||||
return mod.SetRunning(true, func() {
|
return mod.SetRunning(true, func() {
|
||||||
defer mod.serial.Close()
|
|
||||||
|
|
||||||
mod.Info("started on port %s ...", mod.serialPort)
|
mod.Info("started on port %s ...", mod.serialPort)
|
||||||
|
|
||||||
if mod.serial != nil {
|
if mod.serial != nil {
|
||||||
|
defer mod.serial.Close()
|
||||||
|
|
||||||
for mod.Running() {
|
for mod.Running() {
|
||||||
mod.readFromSerial()
|
mod.readFromSerial()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue