X-Git-Url: https://git.gag.com/?a=blobdiff_plain;ds=sidebyside;f=altosdroid%2Fsrc%2Forg%2Faltusmetrum%2FAltosDroid%2FTelemetryService.java;h=f1304a95298f3d645e10eb13419e90ba9d993a07;hb=c6f85cb149dff8732104521cb62b355e8a0d7148;hp=0ddfdfc3ad50c6ed281cac7a05b5910dd43546a7;hpb=2f7015afcca7c6042365d2124d3a5b7219e8e588;p=fw%2Faltos diff --git a/altosdroid/src/org/altusmetrum/AltosDroid/TelemetryService.java b/altosdroid/src/org/altusmetrum/AltosDroid/TelemetryService.java index 0ddfdfc3..f1304a95 100644 --- a/altosdroid/src/org/altusmetrum/AltosDroid/TelemetryService.java +++ b/altosdroid/src/org/altusmetrum/AltosDroid/TelemetryService.java @@ -245,6 +245,9 @@ public class TelemetryService extends Service { } private void startAltosBluetooth() { + if (device == null) { + return; + } if (mAltosBluetooth == null) { if (D) Log.d(TAG, String.format("startAltosBluetooth(): Connecting to %s (%s)", device.getName(), device.getAddress())); mAltosBluetooth = new AltosBluetooth(device, mHandler); @@ -274,6 +277,8 @@ public class TelemetryService extends Service { private void connected() { try { + if (mAltosBluetooth == null) + throw new InterruptedException("no bluetooth"); mConfigData = mAltosBluetooth.config_data(); } catch (InterruptedException e) { } catch (TimeoutException e) {