Skip to content
This repository has been archived by the owner on Oct 1, 2024. It is now read-only.

Commit

Permalink
Fixed exception which occurs if one of the include directories doesn'…
Browse files Browse the repository at this point in the history
…t exists and we try to search it for Arduino.h
  • Loading branch information
elektronikworkshop authored and adiazulay committed Jan 19, 2021
1 parent 70d323d commit 194dc92
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/arduino/intellisense.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,13 @@ async function findDirContaining(dir: string, what: string): Promise<string | un
const readdir = tp.promisify(fs.readdir);
const fsstat = tp.promisify(fs.stat);

for (const entry of await readdir(dir)) {
let entries: string[];
try {
entries = await readdir(dir);
} catch (e) {
return undefined;
}
for (const entry of entries) {
const p = path.join(dir, entry);
const s = await fsstat(p);
if (s.isDirectory()) {
Expand Down

0 comments on commit 194dc92

Please sign in to comment.