Clean up security token transport if connection procedure failed
This commit is contained in:
@@ -103,6 +103,7 @@ public class SecurityTokenConnection {
|
||||
*/
|
||||
@VisibleForTesting
|
||||
void connectToDevice(Context context) throws IOException {
|
||||
try {
|
||||
// Connect on transport layer
|
||||
transport.connect();
|
||||
|
||||
@@ -125,6 +126,10 @@ public class SecurityTokenConnection {
|
||||
isPw3Validated = false;
|
||||
|
||||
smEstablishIfAvailable(context);
|
||||
} catch (IOException e) {
|
||||
transport.release();
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
|
||||
Reference in New Issue
Block a user