mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-03-15 07:29:15 +01:00
Catch invalid number decoding to cover cases where there is no IP address.
This commit is contained in:
parent
4233c7da0d
commit
cfb9f1277e
@ -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