mirror of
https://github.com/nonoo/kappanhang.git
synced 2025-12-05 23:52:01 +01:00
Fix panic on tune stop after the timeout
This commit is contained in:
parent
c71f75fc8a
commit
5ad5570c7d
|
|
@ -532,7 +532,10 @@ func (s *civControlStruct) decodeTransmitStatus(d []byte) bool {
|
|||
} else {
|
||||
if s.state.tune { // Tune finished?
|
||||
s.state.tune = false
|
||||
s.state.tuneTimeoutTimer.Stop()
|
||||
if s.state.tuneTimeoutTimer != nil {
|
||||
s.state.tuneTimeoutTimer.Stop()
|
||||
s.state.tuneTimeoutTimer = nil
|
||||
}
|
||||
_ = s.getVd()
|
||||
}
|
||||
}
|
||||
|
|
@ -1024,6 +1027,7 @@ func (s *civControlStruct) setTune(enable bool) error {
|
|||
if enable {
|
||||
b = 2
|
||||
s.state.tuneTimeoutTimer = time.AfterFunc(tuneTimeout, func() {
|
||||
s.state.tuneTimeoutTimer = nil
|
||||
_ = s.setTune(false)
|
||||
})
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in a new issue