Skip to content

Commit e318c9a

Browse files
Matthew XieAndroid (Google) Code Review
authored andcommitted
Merge "Check null of address in onDeviceCreated" into jb-dev
2 parents e849230 + 02c4b35 commit e318c9a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

core/java/android/server/BluetoothEventLoop.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,14 +268,18 @@ private void onCreatePairedDeviceResult(String address, int result) {
268268
*/
269269
private void onDeviceCreated(String deviceObjectPath) {
270270
String address = mBluetoothService.getAddressFromObjectPath(deviceObjectPath);
271+
if (address == null) {
272+
Log.e(TAG, "onDeviceCreated: device address null!" + " deviceObjectPath: " +
273+
deviceObjectPath);
274+
return;
275+
}
271276
if (!mBluetoothService.isRemoteDeviceInCache(address)) {
272277
// Incoming connection, we haven't seen this device, add to cache.
273278
String[] properties = mBluetoothService.getRemoteDeviceProperties(address);
274279
if (properties != null) {
275280
addDevice(address, properties);
276281
}
277282
}
278-
return;
279283
}
280284

281285
/**

0 commit comments

Comments
 (0)