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 committed Aug 22, 2024
1 parent f263255 commit de8d361
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,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 de8d361

Please sign in to comment.