kopia lustrzana https://github.com/mik3y/usb-serial-for-android
Added error management inside read function to get more appropriate exception (#529)
rodzic
54ff9bfa44
commit
399d3c9c2f
|
@ -170,7 +170,7 @@ public abstract class CommonUsbSerialPort implements UsbSerialPort {
|
|||
}
|
||||
|
||||
protected int read(final byte[] dest, final int timeout, boolean testConnection) throws IOException {
|
||||
if(mConnection == null) {
|
||||
if(mConnection == null || mUsbRequest == null) {
|
||||
throw new IOException("Connection closed");
|
||||
}
|
||||
if(dest.length <= 0) {
|
||||
|
|
Ładowanie…
Reference in New Issue