Merge pull request #24 from cyoung/ahrs_dev

Fix nil pointer dereference crash.
pull/592/head
Eric Westphal 2017-03-30 08:12:33 -04:00 zatwierdzone przez GitHub
commit c12aa3e728
4 zmienionych plików z 38 dodań i 38 usunięć

Wyświetl plik

@ -276,13 +276,13 @@ func handleSettingsSetRequest(w http.ResponseWriter, r *http.Request) {
globalSettings.GPS_Enabled = val.(bool)
case "IMU_Sensor_Enabled":
globalSettings.IMU_Sensor_Enabled = val.(bool)
if !globalSettings.IMU_Sensor_Enabled {
if !globalSettings.IMU_Sensor_Enabled && globalStatus.IMUConnected {
myIMUReader.Close()
globalStatus.IMUConnected = false
}
case "BMP_Sensor_Enabled":
globalSettings.BMP_Sensor_Enabled = val.(bool)
if !globalSettings.BMP_Sensor_Enabled {
if !globalSettings.BMP_Sensor_Enabled && globalStatus.BMPConnected {
myPressureReader.Close()
globalStatus.BMPConnected = false
}