LE/Android: add consistency check in method called from Qt API

Call to includedServices() from Qt side after unexpected disconnection
leads to NullPointerException due to unchecked member access. Fix that!

Change-Id: Iae89801d7af86d5a3f34ebba9eb2ea12da252cd2
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
This commit is contained in:
Konstantin Ritt 2018-02-20 14:37:49 +03:00
parent 773dfe8222
commit a61ee48bc1
1 changed files with 3 additions and 0 deletions

View File

@ -839,6 +839,9 @@ public class QtBluetoothLE {
*/
public String includedServices(String serviceUuid)
{
if (mBluetoothGatt == null)
return null;
UUID uuid;
try {
uuid = UUID.fromString(serviceUuid);