Skip to content

Commit 6a20128

Browse files
Fix checkPort
1 parent aa64ef0 commit 6a20128

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

kernel/src/services/DeviceService.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,13 @@ export class DeviceService {
3333
return false;
3434
}
3535
}
36-
finally {
37-
if (this.port) {
38-
await this.port.close();
39-
}
36+
37+
try{
38+
await this.port.close();
39+
}
40+
catch (err) {
41+
console.error('[checkPort]: Failed to close port:', err);
42+
return false;
4043
}
4144

4245
// If we reach here, the port is available

0 commit comments

Comments
 (0)