Avoid NPEs when BluetoothDevice.getName() returns null
This commit is contained in:
parent
9881b6c281
commit
9ae69eac55
|
@ -59,7 +59,7 @@ public class GBDevice implements Parcelable {
|
|||
|
||||
public GBDevice(String address, String name, DeviceType deviceType) {
|
||||
mAddress = address;
|
||||
mName = name;
|
||||
mName = (name != null) ? name : mAddress;
|
||||
mDeviceType = deviceType;
|
||||
validate();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue