1
0
mirror of https://github.com/mik3y/usb-serial-for-android synced 2025-06-07 16:06:10 +00:00

Merge pull request #339 from ybs-github/master

catch exception thrown by `close()` inside `open()`
This commit is contained in:
kai-morich 2021-01-10 10:04:27 +01:00 committed by GitHub
commit 5519182256
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -102,7 +102,9 @@ public abstract class CommonUsbSerialPort implements UsbSerialPort {
mUsbRequest = new UsbRequest(); mUsbRequest = new UsbRequest();
mUsbRequest.initialize(mConnection, mReadEndpoint); mUsbRequest.initialize(mConnection, mReadEndpoint);
} catch(Exception e) { } catch(Exception e) {
close(); try {
close();
} catch(Exception ignored) {}
throw e; throw e;
} }
} }