Added error management inside read function to get more appropriate exception (#529)

pull/540/head
ExPl0siF 2023-08-24 18:49:29 +02:00 zatwierdzone przez GitHub
rodzic 54ff9bfa44
commit 399d3c9c2f
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -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) {