Catch NPE from BluetoothSocket#connect().

This commit is contained in:
akwizgran
2021-03-11 18:00:45 +00:00
parent 74447b8ec3
commit 8b4ff2dc8a

View File

@@ -175,6 +175,11 @@ class AndroidBluetoothPlugin
} catch (IOException e) { } catch (IOException e) {
IoUtils.tryToClose(s, LOG, WARNING); IoUtils.tryToClose(s, LOG, WARNING);
throw e; throw e;
} catch (NullPointerException e) {
// BluetoothSocket#connect() may throw an NPE under unknown
// circumstances
IoUtils.tryToClose(s, LOG, WARNING);
throw new IOException(e);
} }
} }