Avoid NPEs when BluetoothDevice.getName() returns null

This commit is contained in:
cpfeiffer 2016-07-05 21:03:30 +02:00
parent 9881b6c281
commit 9ae69eac55
1 changed files with 1 additions and 1 deletions

View File

@ -59,7 +59,7 @@ public class GBDevice implements Parcelable {
public GBDevice(String address, String name, DeviceType deviceType) { public GBDevice(String address, String name, DeviceType deviceType) {
mAddress = address; mAddress = address;
mName = name; mName = (name != null) ? name : mAddress;
mDeviceType = deviceType; mDeviceType = deviceType;
validate(); validate();
} }