Skip to content

Commit

Permalink
MovingWifiHelper: Fix _SNCF_WIFI_INTERCITES
Browse files Browse the repository at this point in the history
The new JSON dosen't include a "fix" field on french intercity trains anymore, but they're still in use on TGVs and OUIGO
  • Loading branch information
valerierx authored and mar-v-in committed Sep 27, 2024
1 parent 52a08ba commit 9bf8bd3
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ class MovingWifiHelper(private val context: Context) {

private fun parseSncf(location: Location, data: ByteArray): Location {
val json = JSONObject(data.decodeToString())
if(json.getInt("fix") == -1) throw RuntimeException("GPS not valid")
if(json.has("fix") && json.getInt("fix") == -1) throw RuntimeException("GPS not valid")
location.accuracy = 100f
location.latitude = json.getDouble("latitude")
location.longitude = json.getDouble("longitude")
Expand Down

0 comments on commit 9bf8bd3

Please sign in to comment.