mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2025-01-11 09:31:59 +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) {
|
||||
if(intent.getAction().equals(ACTION_CONNECT)) {
|
||||
if (ACTION_CONNECT.equals(intent.getAction())) {
|
||||
String btDeviceAddress = intent.getStringExtra("device");
|
||||
if(btDeviceAddress!=null){
|
||||
if (btDeviceAddress!=null) {
|
||||
GBDevice candidate = DeviceHelper.getInstance().findAvailableDevice(btDeviceAddress, this);
|
||||
if (candidate != null && !candidate.isConnected()) {
|
||||
GBApplication.deviceService(candidate).connect();
|
||||
|
Loading…
Reference in New Issue
Block a user