sendBt might be null

This commit is contained in:
Daniel Martí 2015-04-15 18:00:45 +02:00
parent fae80fbb26
commit 801ec4e7fa

View File

@ -288,13 +288,15 @@ public class FDroidApp extends Application {
e1.printStackTrace();
found = false;
}
if (!found) {
Toast.makeText(this, R.string.bluetooth_activity_not_found,
Toast.LENGTH_SHORT).show();
activity.startActivity(Intent.createChooser(sendBt, getString(R.string.choose_bt_send)));
} else {
sendBt.setClassName(bluetoothPackageName, className);
activity.startActivity(sendBt);
if (sendBt != null) {
if (!found) {
Toast.makeText(this, R.string.bluetooth_activity_not_found,
Toast.LENGTH_SHORT).show();
activity.startActivity(Intent.createChooser(sendBt, getString(R.string.choose_bt_send)));
} else {
sendBt.setClassName(bluetoothPackageName, className);
activity.startActivity(sendBt);
}
}
}