mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2025-01-25 00:57:33 +01:00
Fix crash when opening Gadgetbridge from the notification
intent.getAction() can be null, which would throw a NPE.
This commit is contained in:
parent
96a8785ed5
commit
088b0098b5
@ -553,9 +553,9 @@ public class ControlCenterv2 extends AppCompatActivity
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void handleShortcut(Intent intent) {
|
private void handleShortcut(Intent intent) {
|
||||||
if(intent.getAction().equals(ACTION_CONNECT)) {
|
if (ACTION_CONNECT.equals(intent.getAction())) {
|
||||||
String btDeviceAddress = intent.getStringExtra("device");
|
String btDeviceAddress = intent.getStringExtra("device");
|
||||||
if(btDeviceAddress!=null){
|
if (btDeviceAddress!=null) {
|
||||||
GBDevice candidate = DeviceHelper.getInstance().findAvailableDevice(btDeviceAddress, this);
|
GBDevice candidate = DeviceHelper.getInstance().findAvailableDevice(btDeviceAddress, this);
|
||||||
if (candidate != null && !candidate.isConnected()) {
|
if (candidate != null && !candidate.isConnected()) {
|
||||||
GBApplication.deviceService(candidate).connect();
|
GBApplication.deviceService(candidate).connect();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user