Skip to content

Commit 0af858a

Browse files
author
Akos Kitta
committed
fix: avoid ENOTDIR when opening second instance.
If the resource is a file, do not try to `readdir`, but return undefined Closes #1590 Signed-off-by: Akos Kitta <[email protected]>
1 parent f6275f9 commit 0af858a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: arduino-ide-extension/src/electron-main/theia/electron-main-application.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,8 @@ export class ElectronMainApplication extends TheiaElectronMainApplication {
180180
if (!stats) {
181181
return undefined;
182182
}
183-
if (stats.isFile() && path.endsWith('.ino')) {
184-
return path;
183+
if (stats.isFile()) {
184+
return path.endsWith('.ino') ? path : undefined;
185185
}
186186
try {
187187
const entries = await fs.readdir(path, { withFileTypes: true });

0 commit comments

Comments
 (0)