Skip to content

Commit 978c8fc

Browse files
author
Federico Fissore
committed
Compiler: don't merge if bootloader file is specified but missing. Print a warning instead. Fixes #3394
1 parent 8e76fb8 commit 978c8fc

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

arduino-core/src/processing/app/debug/Compiler.java

+7-3
Original file line numberDiff line numberDiff line change
@@ -1198,15 +1198,19 @@ private File mergeSketchWithBootloaderIfAppropriate(String className, Preference
11981198
return null;
11991199
}
12001200

1201-
File mergedSketch = new File(buildPath, className + ".with_bootloader.hex");
1202-
FileUtils.copyFile(sketch, mergedSketch);
1203-
12041201
String bootloaderNoBlink = prefs.get("bootloader.noblink");
12051202
if (bootloaderNoBlink == null) {
12061203
bootloaderNoBlink = prefs.get("bootloader.file");
12071204
}
12081205

12091206
File bootloader = new File(new File(prefs.get("build.platform.path"), "bootloaders"), bootloaderNoBlink);
1207+
if (!bootloader.exists()) {
1208+
System.err.println(I18n.format(_("Bootloader file specified but missing: {0}"), bootloader));
1209+
return null;
1210+
}
1211+
1212+
File mergedSketch = new File(buildPath, className + ".with_bootloader.hex");
1213+
FileUtils.copyFile(sketch, mergedSketch);
12101214

12111215
new MergeSketchWithBooloader().merge(mergedSketch, bootloader);
12121216

0 commit comments

Comments
 (0)