Skip to content

Commit de2e8b9

Browse files
sigmaaaAndriiFilippov
authored andcommitted
fix: fixing no such file exception (#926)
1 parent ea68617 commit de2e8b9

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

bundles/com.espressif.idf.core/src/com/espressif/idf/core/toolchain/ESPToolChainManager.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ public File findDebugger(String target)
151151
.map(espToolChainElement -> findToolChain(getAllPaths(), espToolChainElement.debuggerPattern))
152152
.findFirst().orElse(null);
153153
}
154-
154+
155155
public File findCompiler(String target)
156156
{
157157
return toolchainElements.values().stream()
@@ -179,7 +179,8 @@ public File findToolChain(List<String> paths, String filePattern)
179179

180180
private Path[] getDirectories(String path)
181181
{
182-
return Arrays.stream(path.split(File.pathSeparator)).map(String::trim).map(Paths::get).toArray(Path[]::new);
182+
return Arrays.stream(path.split(File.pathSeparator)).map(String::trim).map(Paths::get).filter(Files::exists)
183+
.toArray(Path[]::new);
183184
}
184185

185186
private File findMatchingFile(Path dir, String filePattern)

0 commit comments

Comments
 (0)