diff --git a/arduino-core/src/cc/arduino/Compiler.java b/arduino-core/src/cc/arduino/Compiler.java index 06c5be7d7..0280a8a2d 100644 --- a/arduino-core/src/cc/arduino/Compiler.java +++ b/arduino-core/src/cc/arduino/Compiler.java @@ -361,8 +361,10 @@ public class Compiler implements MessageConsumer { Path compiledSketchPathInBuildPath = Paths.get(prefs.get("build.path"), compiledSketch); if (Files.exists(compiledSketchPathInSubfolder)) { compiledSketchPath = compiledSketchPathInSubfolder; - } else { + } else if (Files.exists(compiledSketchPathInBuildPath)) { compiledSketchPath = compiledSketchPathInBuildPath; + } else { + return; } Path copyOfCompiledSketchFilePath = Paths.get(this.sketch.getFolder().getAbsolutePath(), copyOfCompiledSketch);