mirror of
https://github.com/mik3y/usb-serial-for-android.git
synced 2026-08-13 09:23:03 +00:00
improve error quality + test for PR #339
This commit is contained in:
+3
@@ -93,6 +93,9 @@ public abstract class CommonUsbSerialPort implements UsbSerialPort {
|
||||
if (mConnection != null) {
|
||||
throw new IOException("Already open");
|
||||
}
|
||||
if(connection == null) {
|
||||
throw new IllegalArgumentException("Connection is null");
|
||||
}
|
||||
mConnection = connection;
|
||||
try {
|
||||
openInt(connection);
|
||||
|
||||
Reference in New Issue
Block a user