Skip to content

Commit 688c406

Browse files
author
Federico Fissore
committed
Checking every candidate path when exporting, instead of assuming one is good if the other is not. Fixes #3905
1 parent 5c7b8e6 commit 688c406

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

arduino-core/src/cc/arduino/Compiler.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,8 +361,10 @@ private void saveHex(String compiledSketch, String copyOfCompiledSketch, Prefere
361361
Path compiledSketchPathInBuildPath = Paths.get(prefs.get("build.path"), compiledSketch);
362362
if (Files.exists(compiledSketchPathInSubfolder)) {
363363
compiledSketchPath = compiledSketchPathInSubfolder;
364-
} else {
364+
} else if (Files.exists(compiledSketchPathInBuildPath)) {
365365
compiledSketchPath = compiledSketchPathInBuildPath;
366+
} else {
367+
return;
366368
}
367369

368370
Path copyOfCompiledSketchFilePath = Paths.get(this.sketch.getFolder().getAbsolutePath(), copyOfCompiledSketch);

0 commit comments

Comments
 (0)