mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-18 03:52:11 +01:00
Catch invalid number decoding to cover cases where there is no IP address.
This commit is contained in:
parent
32ec48412d
commit
95218802da
@ -72,8 +72,14 @@ public class OPTelemetryService extends Service {
|
||||
break;
|
||||
case MSG_CONNECT:
|
||||
terminate = false;
|
||||
int connection_type;
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(OPTelemetryService.this);
|
||||
int connection_type = Integer.decode(prefs.getString("connection_type", ""));
|
||||
try {
|
||||
connection_type = Integer.decode(prefs.getString("connection_type", ""));
|
||||
} catch (NumberFormatException e) {
|
||||
connection_type = 0;
|
||||
}
|
||||
|
||||
switch(connection_type) {
|
||||
case 0: // No connection
|
||||
return;
|
||||
|
Loading…
x
Reference in New Issue
Block a user