Make sure fs is only updated if dev.FS() succeeds (#11)
This commit is contained in:
parent
2112894889
commit
597e7dab5f
10
socket.go
10
socket.go
@ -112,13 +112,13 @@ func handleConnection(conn net.Conn, dev *infinitime.Device, fs *blefs.FS) {
|
||||
// Get new FS
|
||||
newFS, err := dev.FS()
|
||||
if err != nil {
|
||||
fs = nil
|
||||
log.Warn().Err(err).Msg("Error updating BLE filesystem")
|
||||
} else {
|
||||
// Set FS pointer to new FS
|
||||
*fs = *newFS
|
||||
// Reset updateFS
|
||||
updateFS = false
|
||||
}
|
||||
// Set FS pointer to new FS
|
||||
*fs = *newFS
|
||||
// Reset updateFS
|
||||
updateFS = false
|
||||
}
|
||||
|
||||
// Create new scanner on connection
|
||||
|
Loading…
Reference in New Issue
Block a user